- Messaggi: 6
- Ringraziamenti ricevuti 0
Force Item ID not working
- string
- Autore della discussione
- Offline
- Nuovo Utente
Less
Di più
9 Anni 9 Mesi fa #2162
da string
Force Item ID not working è stato creato da string
I am displaying cp tags inside articles using {cptag} fucntion. I have set force ID in the plugin settings (via Content - Custom Properties Tags Plugin ). When one clicks on one of these tags in an article a list of articles belonging to this tag appears in the search resluts, this view/page appears in the correct Item Id but when I click on one of these articles in the search results page it goes to the incorrect item ID, by default the home page. How can I fix this?
Si prega Accesso o Crea un account a partecipare alla conversazione.
- andrea_4g
- Offline
- Amministratore
Less
Di più
- Messaggi: 1122
- Ringraziamenti ricevuti 163
9 Anni 9 Mesi fa #2165
da andrea_4g
The *article* Menu Item Id doesn't depend on Custom Properties (unlike CP Tags Menu Item Ids).
We can distinguish 2 cases:
== SEF is OFF ==
The article Url will look like:
index.php?option=com_content&view=article&id=<art.nr>:<art.slug>&catid=<catid>&Itemid=<a-menu-item-id>
Joomla is able to determine which extension will have to handle the request (i.e. com_content) and will forward the parameters to it (view=article, id=...).
Joomla will then read the Itemid parameter, to know which menu item is going to be set as active and which modules need to be displayed.
If you force an Item Id of your choice, it will work.
In fact, if you set parameter 'Use Itemid' = 'Current page', in main Custom Properties options, you'll see that the articles of the result list will open in the very same page.
I must stress that this only work if SEF is off.
== SEF is ON ==
The same article's Url will look like like:
<menu-item-alias>/<cat-id>->category-slug>/<art-id>-<art-alias>
When Joomla receives such request, it will first match /menu-item-alias/ against the table of actual menu aliases.
When a match is found, it then gathers the params linked to it from the menu item table (i.e. option=com_content&view=article&...) and also the menu item id to attach the modules too.
If you tweak the Menu Item id, you break the SEF encoding and decoding mechanism and you likely end up with a 404 page.
For instance, *if* the menu item is not of 'com_content' type, the wrong extension is invoked and the additional url parameters are forwarded to it, therefore causing a malfunction.
== Conclusions ==
- You don't want to alter Menu Item Ids when SEF is on
- You need to let Joomla SEF engine find out and assign the appropriate Menu Item Ids
== Suggestion ==
Because Menu Item Ids for articles depends by actual menu items pointing to them (or to their parent categories), you might want to create one or more menu items pointing to your articles, so that you have a reliable way to assign modules to them. Hidden Menu Items work too.
Risposta da andrea_4g al topic Force Item ID not working
... but when I click on one of these articles in the search results page it goes to the incorrect item ID, by default the home page
The *article* Menu Item Id doesn't depend on Custom Properties (unlike CP Tags Menu Item Ids).
We can distinguish 2 cases:
== SEF is OFF ==
The article Url will look like:
index.php?option=com_content&view=article&id=<art.nr>:<art.slug>&catid=<catid>&Itemid=<a-menu-item-id>
Joomla is able to determine which extension will have to handle the request (i.e. com_content) and will forward the parameters to it (view=article, id=...).
Joomla will then read the Itemid parameter, to know which menu item is going to be set as active and which modules need to be displayed.
If you force an Item Id of your choice, it will work.
In fact, if you set parameter 'Use Itemid' = 'Current page', in main Custom Properties options, you'll see that the articles of the result list will open in the very same page.
I must stress that this only work if SEF is off.
== SEF is ON ==
The same article's Url will look like like:
<menu-item-alias>/<cat-id>->category-slug>/<art-id>-<art-alias>
When Joomla receives such request, it will first match /menu-item-alias/ against the table of actual menu aliases.
When a match is found, it then gathers the params linked to it from the menu item table (i.e. option=com_content&view=article&...) and also the menu item id to attach the modules too.
If you tweak the Menu Item id, you break the SEF encoding and decoding mechanism and you likely end up with a 404 page.
For instance, *if* the menu item is not of 'com_content' type, the wrong extension is invoked and the additional url parameters are forwarded to it, therefore causing a malfunction.
== Conclusions ==
- You don't want to alter Menu Item Ids when SEF is on
- You need to let Joomla SEF engine find out and assign the appropriate Menu Item Ids
== Suggestion ==
Because Menu Item Ids for articles depends by actual menu items pointing to them (or to their parent categories), you might want to create one or more menu items pointing to your articles, so that you have a reliable way to assign modules to them. Hidden Menu Items work too.
I seguenti utenti hanno detto grazie : string
Si prega Accesso o Crea un account a partecipare alla conversazione.
- string
- Autore della discussione
- Offline
- Nuovo Utente
Less
Di più
- Messaggi: 6
- Ringraziamenti ricevuti 0
9 Anni 9 Mesi fa #2181
da string
Risposta da string al topic Force Item ID not working
Hi Thanks for all your help.
It makes alot of sense. Hidden menus work like magic!
It makes alot of sense. Hidden menus work like magic!
Si prega Accesso o Crea un account a partecipare alla conversazione.
- kuantan
- Offline
- Nuovo Utente
Less
Di più
- Messaggi: 1
- Ringraziamenti ricevuti 0
8 Anni 8 Mesi fa - 8 Anni 8 Mesi fa #2409
da kuantan
Risposta da kuantan al topic Force Item ID not working
Thanks, I think I am about to solve my problem!
But where in Joomla can I set:
set parameter 'Use Itemid' = 'Current page', in main Custom Properties options
Appreciate your help....
UPDATE:
Sorry, obviously this a feature of your "Custom Properties 3 for Joomla 3.x". So I presume there is no way to do this in default Joomla 3.x.
I am using gantry5 template styles, so I presume that(using your extension) a category list of articles will open the article in the same template style as the page that displays the category list, if I set 'Use Itemid' = 'Current page' (with sef==off). Correct?
But where in Joomla can I set:
set parameter 'Use Itemid' = 'Current page', in main Custom Properties options
Appreciate your help....
UPDATE:
Sorry, obviously this a feature of your "Custom Properties 3 for Joomla 3.x". So I presume there is no way to do this in default Joomla 3.x.
I am using gantry5 template styles, so I presume that(using your extension) a category list of articles will open the article in the same template style as the page that displays the category list, if I set 'Use Itemid' = 'Current page' (with sef==off). Correct?
Ultima Modifica 8 Anni 8 Mesi fa da kuantan.
Si prega Accesso o Crea un account a partecipare alla conversazione.
- andrea_4g
- Offline
- Amministratore
Less
Di più
- Messaggi: 1122
- Ringraziamenti ricevuti 163
8 Anni 8 Mesi fa #2410
da andrea_4g
Risposta da andrea_4g al topic Force Item ID not working
Correct.
Regardless of the template you are using.
Regardless of the template you are using.
Si prega Accesso o Crea un account a partecipare alla conversazione.
Tempo creazione pagina: 0.171 secondi