I found that it is possible to define a specific page layout depending on module, function and category. I would like to do this only for a module, so that I have the general list template and one that is used only for a specific category.
I could not find any docs for this, and from what I know so far, templates are bound to certain functions by their names, but would there be a way to achieve this? In the old days in Pagesetter this was easy with different document types, but now I need to do this in Content, where there is no such distinction.
So, is it possible to override standard module templates depending on categories?
--
And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
And I was happy and smiled - and it came worse...
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- jmvaughn responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 12:05 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
(solved) category-specific module template?
-
- Rank: Softmore
- Registered: Aug 12, 2003
- Last visit: Mar 08, 2010
- Posts: 111
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2411
I've wrote a Wiki page (but in the BlankTheme's one) talking about it:
Specific page templates in Zikula
hope it helps
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Softmore
- Registered: Aug 12, 2003
- Last visit: Mar 08, 2010
- Posts: 111
Ah, that's the one I meant at the beginning of my first posting. Problem is, this seems to allow to define a special page template for a certain category. If I understand correctly, I could use a different page layout then, but within that page, a certain module would still use the same template for the same function.
What I like to achieve is to override a module template depending on a certain category. Everything else may stay the same, only that module should use a different template if a specific category is listed. I suppose that (if this is possible at all) it will need to be defined in such a special page layout, but I don't know how (if at all) to achieve the module template override within that page.
--
And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
And I was happy and smiled - and it came worse... -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2411
Issue solved?
As it's a requirement in the context of the module, this can be solved in the module templates better,
from the theme you can add a special class to the main container for specific categories, but that will let you to control the CSS only (that's a lot, but depends if you handle specific information per category)... so
i guess you probably solved it in the view template of the module
with a conditional checking which Category (if any) is being displayed...
For this kind of stuff <--[pndebug]--> is the better friend
Greetings!
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Softmore
- Registered: Aug 12, 2003
- Last visit: Mar 08, 2010
- Posts: 111
nestormateo
Issue solved?
Not yet. I did not see any different response (use of the template I set), no matter what settings I used, so currently I try to use a workaround for the workaround. I guess I need to go back to square one and start with the News example you gave to make sure the procedure itself is correct.
Edit: It's good the semester is over...
After going through all config files again I found mistakes, and now at least it works with the Content document PID. With categories however still no success. But now I know the procedure is correct, so it is just one issue that's left...
edited by: dl7und, Jul 03, 2009 - 11:15 PM
--
And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
And I was happy and smiled - and it came worse... -
- Rank: Softmore
- Registered: Aug 12, 2003
- Last visit: Mar 08, 2010
- Posts: 111
Aaarrrrghhhh, I think I found the problem - and if it is, then there's probably no hope. The page you wrote says the theme engine parses any arguments added to the URL, and the News example has both "view" function and category ID. I just checked: Yes, News allows to view by category, that shows the intro text.
Content however does not allow that, it needs a document ID for the view function. Categories only work with the list function. Just tried, with list it works, even for secondary categories - but for list I don't need it...
So, it doesn't solve my problem, but the procedure itself works...
--
And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
And I was happy and smiled - and it came worse... -
- Rank: Softmore
- Registered: Aug 12, 2003
- Last visit: Mar 08, 2010
- Posts: 111
I got it, finally. The key was to go the other way... My situation: I have a number of Content documents belonging to one category. If one of them is viewed, I want to display a certain menu block. For all other Content documents and also all other content, other blocks should be displayed.
Fortunately, the "other" Content documents are few, so my solution was this: In pageconfiguration.ini, I define rules for the "other" documents, followed by a rule for the Content module in general. It seems that each document requires its own rule:
Code
I am using a two-col theme, with the "regular" blocks assigned to left blocks, and the special menu to right blocks. For reasons unknown to me the right block would show up on top of the center block in "regular" page templates, so I modified both home.htm and master.htm to include this:
Code
The file "empty.htm is, as the name implies, empty. Finally I copied home.htm to special.htm and modified one line:
Code
<!--[blockposition name=left]-->
I simply replaced "left" with "right". I also do not need to assign empty.htm to left blocks, they don't show up. Finally it works.
Thanks for the docs, Mateo!
--
And out of the chaos sounded a voice and spoke: "Be happy and smile, for it could have come worse."
And I was happy and smiled - and it came worse...
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
