Is a News Module the best solution for this unusual layout concept?

General project discussion. NOT for help questions.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

My client wants the site to function exactly like the graphic below.
The HEADER and FOOTER would be global and editable.
The MENU would be editable and linked to CATEGORY PAIRINGS.
Creation of a new CATEGORY automatically adds a MENU item.
Creation of a new PAIRING is based on a CATEGORY template.

Image

So, if the CATEGORY is "Jewelry" and the client wants to add a wristwatch on the left side and a necklace on the right side, he would log in to the admin panel, find the "Jewelry" CATEGORY template and add another pairing (in this case a wristwatch and necklace). Once the new pairing is added, it automatically becomes part of the "Jewelry" section and will be available by clicking the "NEXT" and "PREVIOUS" buttons.

Essentially, each pairing is like a "news item" being displayed one item at a time. Sort of like a blog if a blog only displayed one update per page.

Ideally, they would be able to organize the order of the pairings, unlike a News Module which typically puts the latest News at the top of the list.
But, a news module is the only way I can think of doing this that will allow the Previous and Next buttons to function without doing a lot of manual coding for every update.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

So, since I will be paying the Licensing Fee on this project and probably just keeping the CMSMS branding on future projects, hopefully Calguy1000 (and whoever else) won't feel disgusted about helping me figure out this problem. CMSMS looks like the best and cleanest solution I've found so far after countless hours screwing around with MODx, Joomla, Drupal and WordPress, so I would like to be a happy and contributing member of this community one day.  ;D
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by calguy1000 »

Please remember your licensing fee covers CMS and the core modules

it does not necessarily include any of the modules that you can download from the forge or that aren't included in the CMS didstribution.

i.e: modules that you download from the forge or from module manager are probably not included in your license.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

I'm not concerned about those at all. No module would have branding splashed across the top and bottom of the page, I'm sure. If it has a copyright claim anywhere on it, I'm not worried about that either.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

Aha! I think I figured it out!

I could use the News Module to display each PAIR as a singular "news article" (hopefully it allows singular posts) and within the news article I can use the PageBlocks Module to allow individual content management of LEFT and RIGHT items in the PAIR.

Make sense? If this is how simple the solution is and I see it works, I will lower the price and keep all the GPL licensing in tact... because if this is the solution, then CMSMS is even easier than MODx (which was my previous "best choice") and I will of course love to support its development by helping make it a more popular choice.

Will be testing this over the weekend and, if it works out, I'll let you know and show the results.
GraemeS
Forum Members
Forum Members
Posts: 36
Joined: Sun Jan 06, 2008 6:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by GraemeS »

hope it all works out for you nate22

@calguy i greatly appriciate your work you do here at cmsms but do also understand this whole copyright issue and understanding had seemed to ruslte some feathers, just thought you may have ( you may already do, i just not had enough coffee yet to realise) if you offer a licensing module pack for your modules? as a heavily valued cmsms member sure people who do look at de-branding CMSMS and its modules would happily pay a separate licensing to use your great modules. Like i said you probably already offer this just maybe worth making note in forge to where potential license payers could find this infomation
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

Actually, the more I thought about this, the more I relied on what I was already familiar with to try and figure this problem out. I concluded that this is super-easy with MODx:

1. Wayfinder menu snippet at top
2. Ditto module for middle
3. 2 Template Variables within the Ditto chunk
4. [+previous+] and [+next+] Ditto Placeholders

I don't see how it could get any easier than that.

Does CMSMS have anything similar to the all-purpose Template Variable feature MODx uses so well? I want to switch to CMSMS because the MODx Admin panel is too much.
Vin

Re: Is a News Module the best solution for this unusual layout concept?

Post by Vin »

News module seems a very good choice to me...
What I would do would be inserting the {news browsecat='1'} into SummaryTemplate (at the top),

and using the {eval var=$entry->summary} and {eval var=$entry->content} as 'fake' pairings (remove those {if} and {/if} conditions and morelink around these "evals").

Since it would be for a specific purpose, I would change some texts in lang files accordingly.

But I think it could be done with PageBlocks and {cms_selflink dir='next'}{cms_selflink dir='prev'} (a cmsms tag}, then the categories would be actually in page hierarchy (is it going to be just these pages or... just can't see in the MODx template where the [+previous+][+next+] should stop.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

Oh cool, thanks Vin! Now I have some code ideas to start playing with for CMSMS.

In MODx, I think the Ditto feature utilizes the  [+previous+] and [+next+] buttons just to move to the next location in the array. Ditto has the [+previous+] and [+next+] features primarily based around the concept of browsing news content, so when you add a news item, it is automatically entered into the array. At least I think that's what it does. Ditto is one thing I've never experimented with before and have spent the greater part of today playing with it.
Vin

Re: Is a News Module the best solution for this unusual layout concept?

Post by Vin »

I've been thinking about the pagination and pairings a little... actually, it seems you don't have to install PageBlocks in the case you want to use the page hierarchy structure.

The {content} tag may have block parametre, like {content block="Second Content Block"}, which enables a second content block. To show it just for specified set of pages, I would use Calguy's CGSimpleSmarty functions (you can download them with ModuleManager) , namely $cgsimple->get_root_alias(), in the {if} conditions, in order to show the second block based on the root page's alias:

Code: Select all

{if $cgsimple->get_root_alias()=='the-specified-root-page-alias'}{content block="Second Content Block"}{/if}
.

For pagination, I've got an idea of using cms_selflink in a menu template (called e.g. "prev-next-template"), which would contain nothing more but:

Code: Select all

{if $count > 0}

	{foreach from=$nodelist item=node name='prevnext'}

                {if $node->current == '1'}

{* see smarty documentation for more insight:  http://www.smarty.net/manual/en/language.function.foreach.php*}

                        {if $smarty.foreach.prevnext.first}You're on the first page{else}{cms_selflink dir='prev'}{/if}

                        {if $smarty.foreach.prevnext.last}You're on the last page{else}{cms_selflink dir='next'}{/if}

                {/if}

	{/foreach}
{/if}
,

using a UDT called "current_page_alias", which would contain:

Code: Select all

global $gCms;
$gCms->variables['page_name']
(please someone correct me if there is a way to show page's alias without creating a UDT)

and using it in the page template as:

Code: Select all

{if $cgsimple->get_root_alias()=='the-specified-root-page-alias'}
{cms_module module='menumanager' template='prev-next-template' start_page=$current_page_alias show_root_siblings='1'}
{/if}
Last edited by Vin on Wed Mar 19, 2008 9:18 pm, edited 1 time in total.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

Thank you, Vin. That seems like an elegant solution. If I use it, I guess I'd have to leave the branding on the admin page as per Calguy's request. I suppose if Calguy's modules are the more important ones used in CMSMS I will have to use MODx for this particular project, but it is nice to understand the different terminology to go about solviing the same problem in both environments.

What is really cool, though, is that using these frameworks is helping me to understand the logic of regular PHP coding. It's really fantastic because even though I will never need to code from scratch thanks to the amount of frameworks out there, eventually I will be able to code circles around those frameworks with ease. Then I'LL be one of the guys who can answer newb questions on these forums!  ;D
Pierre M.

Re: Is a News Module the best solution for this unusual layout concept?

Post by Pierre M. »

Hello nate22,

warning : I haven't read all the posts in the thread so this may not be relevant.

I think there is no need of the News module, no need of coding : your yellow prototype is a standard template with two {content ...} blocs (columns). You create a new page to create a "pair", you put it where you want in the hierarchy (categories) wich generates the {menu ...}.

Pierre M.
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

Pierre M. wrote: Hello nate22,

warning : I haven't read all the posts in the thread so this may not be relevant.

I think there is no need of the News module, no need of coding : your yellow prototype is a standard template with two {content ...} blocs (columns). You create a new page to create a "pair", you put it where you want in the hierarchy (categories) wich generates the {menu ...}.

Pierre M.
Wouldn't this add a new Menu item for every pair added? I don't want that. I want only 5 Menu Items (categories) and under each will be a potentially infinite number of pairings which are accessible only through "previous" and "next" buttons.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by Nullig »

It would add a menu item (submenu), but these could be "hidden" in the menu itself.

Nullig
nate22
Forum Members
Forum Members
Posts: 63
Joined: Thu Mar 06, 2008 8:09 pm

Re: Is a News Module the best solution for this unusual layout concept?

Post by nate22 »

Nullig wrote: It would add a menu item (submenu), but these could be "hidden" in the menu itself.

Nullig
How? I just went back and expected to see it in the Beginner's step-by-step, but it doesn't mention how to hide submenus. I'm guessing it's something like display=0 appended to some tag (don't know which) but I  know that's not correct.
Post Reply

Return to “General Discussion”