How to do module calls to a page over query string from links in content?
Posted: Sat Jan 10, 2009 1:17 am
(Apologies if posting in wrong forum!)
I've put the subject of this post as "How to do module calls to a page over query string from links in content?", but I'm not sure if this actually what I might need to do.
To explain...
I have setup a site that uses the News module for news items, events listings and a resource directory of short information articles, files and links to external websites. There are 3 main categories each with 5 sub-categories.
Now, I started to produce an individual page for each of the 3 main categories, with some introductory text for each and the relevant module call in the content, e.g. :
I realised I'd probably need to create a page for each individual sub-category as well, making 15 pages.
But I then remembered that users would need to view all resources by date or in alphabetical order, also giving them the choice to view the categories either by browsing 10 on a page with summaries, or as one big long simplified list (using custom templates).
I thought that this would have to be done by creating 4 individual pages for each of the 15 sub categories each with a heading, links to the pages with the other options, and module calls like the following:
It was when I started thinking that users would probably also like to be able to view all options in reverse order (Z to A and oldest article first) that I realised that this whole thing was going to get very time-consuming and unwieldy, and that there must be a more elegant way of doing it.
To me, a logical solution is a single page that can handle module calls to all categories and sub-categories and viewing options, passed on from links within itself using query strings. Or at the very least a page for each of the 3 main categories that can do the same. This is something I could do with basic PHP, but I can't work out how to mix smarty module calls and PHP like that within the CMS content.
I'm not a complete beginner - I've set up 4 sites with CMSMS, I know the basics of PHP, am getting my head round smarty and have written my own UDTs, but I think I've fried my brain today as I'm stumped as to a way of proceeding.
Perhaps I need to write a UDT that creates the links? Or a page template that can process the code? Or both? My head hurts!
Anyone care to help? Thanks!
I've put the subject of this post as "How to do module calls to a page over query string from links in content?", but I'm not sure if this actually what I might need to do.
To explain...
I have setup a site that uses the News module for news items, events listings and a resource directory of short information articles, files and links to external websites. There are 3 main categories each with 5 sub-categories.
Now, I started to produce an individual page for each of the 3 main categories, with some introductory text for each and the relevant module call in the content, e.g. :
Code: Select all
{news category="Resources*" number="10"}
But I then remembered that users would need to view all resources by date or in alphabetical order, also giving them the choice to view the categories either by browsing 10 on a page with summaries, or as one big long simplified list (using custom templates).
I thought that this would have to be done by creating 4 individual pages for each of the 15 sub categories each with a heading, links to the pages with the other options, and module calls like the following:
Code: Select all
{news category="Careers Resources" sortby="news_title" sortasc="true" summarytemplate="withsummary" number="10"}
{news category="Careers Resources" sortby="news_title" sortasc="true" summarytemplate="simplelist"}
To me, a logical solution is a single page that can handle module calls to all categories and sub-categories and viewing options, passed on from links within itself using query strings. Or at the very least a page for each of the 3 main categories that can do the same. This is something I could do with basic PHP, but I can't work out how to mix smarty module calls and PHP like that within the CMS content.
I'm not a complete beginner - I've set up 4 sites with CMSMS, I know the basics of PHP, am getting my head round smarty and have written my own UDTs, but I think I've fried my brain today as I'm stumped as to a way of proceeding.
Perhaps I need to write a UDT that creates the links? Or a page template that can process the code? Or both? My head hurts!
Anyone care to help? Thanks!