Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » URL based, but switching templates...
URL based, but switching templates based on specific menu
URL based, but switching templates based on specific menu
Hello,
I am having trouble figuring out what should be simple logic.
My site is using url based rules. That is, if the url is http://apples.website.com/ it uses one template. If it is http://oranges.website.com/ it uses another template.
I do that all within separate rules the stop with success.
The above works fine!
But for some pages I want to use a template that looks different for certain pages with one of the urls that is already working fine with one of the above rules.
So I have set up a category that includes specific articles. And I created a menu that displays the category's article titles. I call Chameleon Special Template.
I created a new rule, this time assigning it to the Menu that has the Category links. But it is not changing anything. The rule follows the previous rule (which I changed to continue. WHen the Category List did not work I changed the menu item to a specific article. But that also did not bring up the modified template.
Any suggestions? Usibg Sh404sef, but have been purging the urls)
Thanks!
P.S. Merry Christmas Day!
Re: URL based, but switching templates based on specific menu
Well I am now able to switch templates based on article ID.
But I would prefer to switch templates based on menu item.
I assigned certain articles (which required a different template) to a category and then created a menu item that lists articles in its category. So instead of making the rule work with individual articles I made a rule that it switches templates based on menu item. I selected the menu item that contains the Category List.
Specifically:
Menu Item Handling "Include selected items"
Then, in the list I selected the menu items.
However it doesn't work. Here's what debug says:
Processing rule id 8 ("WIDE Interior Pages dev6.[domain hidden for privacy].ucla.edu")
- Domain name: "dev6.[domain hidden for privacy].ucla.edu" is in the include list - succeeding
- URL: "http://dev6.[domain hidden for privacy].ucla.edu/faculty-2" contains "" ? - succeeding
- Menu handling: currently in menu name: [invalid menu item], Menu id: [invalid menu item: 98]
- Menu items: current menu item is not in list of menu items to include - failing
Started FAIL action for rule id 8
Finished FAIL action: default template style not changed
Finished all rules
Final template style set to "28|music"
So I am not sure why it would be calling the menu item invalid.
I should note that the visitor gets to the page via text link. However the pages itself is indeed in the menu that contains the category.
Where does Chameleon get the "Menu item" id from? Since I simply highlighted the menu item I would assume the Menu item id would be correct????
Any suggestions?
Thanks!
Re: URL based, but switching templates based on specific menu
Hi
As I think about this, I think the problem is because I don't want to have to list each article item to trigger the template to switch. I just want any article in a certain category to switch to the new template.
Perhaps that's where my Chameleon logic went wrong?
Perhaps Chameleon can't "look" at a menu item > Category List and then "say" that any article in that menu item > Category List will switch to the new template.
So I guess my question to you is -- is there a way have any article in a certain article category (assigned to a specific menu item as a Category List) switch to a different template.
Or is it I cannot use Category List to trigger a switch to a different template for all the articles in that specific Category list.
And that is perhaps why debug is showing " [invalid menu item: 98] " The menu item is pointing to a Category List item ID -- not an individual article item ID ??????
Whew! This probably took more explanation than needed!
Rowby
Re: URL based, but switching templates based on specific menu
Hi Rowby,
You're supposed to be able to trigger an action based on the articles from a particular category. One hiccup may be that if you simply specify a category, then the category list/blog page will trigger it as well as the articles it contains triggering it.
So, if you just want the articles in a category to trigger the action, then you can combine 2 things:
1 - select the category
2 - also select the page type: "article".
(both in the same rule)
The invalid menu item is a little strange though – could it be that you used to have a menu item that was a category list/blog, and it had Itemid 98, and somehow the articles are still linked to that menu item? Take a look at your "trashed" menu items and see if #98 is still there? Or perhaps #98 is another live menu item that's "grabbing" the individual articles. Joomla does get a little confused about this sometimes.
Another way that a defunct Itemid can get associated with articles is if you have linked to them directly from the fulltext editor, then your menu items have changed. Sometimes this causes the old Itemid to become embedded in the HTML.
Hope that helps,
Stephen
Re: URL based, but switching templates based on specific menu
Hi
I eliminated MENU from the equation. My rule now has "## ignore ##" Menu and Menu Item(s). (I am assuming I don't need to include menu specifics for a rule to work.)
So now the rule only is based on the url, set template style (WideMusic Interior) and the articles in a specific category (Chameleon: WIDE MUSIC PAGES).
It works when I only include the article ID. It doesn't work when I only select Page Type (Article) and Category: "Chameleon WIDE MUSIC PAGES"
Just to be sure I emptied trash on categories and articles. I went into Joomla 3.1.x Extension manager and confirmed that the database structure was up to date. In System I Cleared cache and Purged Expired cache.
In SH404sef I purged URLS.
I guess what is confusing is it works with article id but, in my case, not with category ID.
Here's the debug info (with domain's blocked out for privacy):
Code:
CHAMELEON DEBUG ON
Current date and time: "2013-12-30 20:58:27pm" in timezone "UTC"
Processing rule id 5 ("SITE INFO LEAVING OUT FOR PRIVACY" ")
- Domain name: "dev6.xxx.xxx.xxx" is not in the include list - failing
Started FAIL action for rule id 5
Finished FAIL action: default template style not changed
Processing rule id 4 ("XXX Site")
- Domain name: "ev6.xxx.xxx.xxx" is not in the include list - failing
Started FAIL action for rule id 4
Finished FAIL action: default template style not changed
Processing rule id 6 ("SITE INFO LEAVING OUT FOR PRIVACY")
- Domain name: "ev6.xxx.xxx.xxx" is not in the include list - failing
Started FAIL action for rule id 6
Finished FAIL action: default template style not changed
Processing rule id 7 ("SITE INFO LEAVING OUT FOR PRIVACY")
- Domain name: "dev6.xxx.xxx.xxx" is in the include list - succeeding
Started SUCCEED action for rule id 7
Finished SUCCEED action: default template style was set to "28|music"
Processing rule id 8 ("MUSIC WIDE Interior Pages dev6.xxx.xxx.xxx")
- Domain name: "dev6.xxx.xxx.xxx" is in the include list - succeeding
- URL: "http://dev6.xxx.xxx.xxx/faculty-2" contains "" ? - succeeding
- Page types: current page (article) is on list of page types to include - succeeding
- Categories: category id of current category or article is not in the include list
- Categories: none of the specified categories were found - failing
Started FAIL action for rule id 8
Finished FAIL action: default template style not changed
Finished all rules
Final template style set to "28|music"
Here's a link to some screen captures.
Thanks,
Rowby
Rowby
Re: URL based, but switching templates based on specific menu
To update:
The problem in this case was due to an out-of-date entry in sh404SEF that encoded the wrong category id (catid) into the URL of the page for one of the artcles. Chameleon, via JomGenius, trusts the catid URL parameter if it exists, and considers that the article belongs to that category even if that conflicts with the value in the database. It does this to avoid a database query if there's a URL parameter for the catid.
Once this conflict was resolved, Chameleon was able to correctly determine the category of the article, and operated correctly.
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » URL based, but switching templates...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 1
- Guests Online:
- 136
- Online:
- uistr4qx
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked