CMS Made Simple Forums
https://forum.cmsmadesimple.org/

Workshop: M&C Module Factory: template code examples
https://forum.cmsmadesimple.org/viewtopic.php?f=66&t=47367
Page 1 of 1

Author:  sanderhartveld [ Wed Sep 15, 2010 9:50 am ]
Post subject:  Workshop: M&C Module Factory: template code examples

Hi Jean-Christophe,
Could you please post some template code examples for using module extender objects.
Thanks, Sander

Author:  totophe [ Wed Sep 15, 2010 10:02 am ]
Post subject:  Re: Workshop: M&C Module Factory: template code examples

First shot :-)

Display_details template example with ModuleXtender calls:

Code:
<h1>{$item->title}</h1>
<a href="{Tasks parent_item=$item->id action="geturl" urlaction="default"}">Tasks</a>

{foreach from=$item->xtended_felist->images item=entry}
<a href="{$entry->url}" target="_new">
<img src="{$entry->resized_images.medium}" />
</a>
{/foreach}


{foreach from=$item->xtended_felist->documents item=entry}
<li><a href="{$entry->url}" target="_new">
{if $entry->title ne ''}{$entry->title}{else}{$entry->filename}{/if}
</a></li>
{/foreach}

<pre>
{$item->xtended_felist|var_dump}
</pre>


Calling ModuleXtender with Page or Category filters:

Code:
{Projects currentpage=1}
or
{Projects options=2}

Author:  totophe [ Fri Sep 17, 2010 2:59 pm ]
Post subject:  Re: Workshop: M&C Module Factory: template code examples

Show sub modules:

create a filter "parent_item" on the field parent_item

Then inside the parent module template, call:
Code:
{NewsletterSubarticles parent_item=$item->getId()}

Author:  totophe [ Tue Sep 21, 2010 8:23 am ]
Post subject:  Re: Workshop: M&C Module Factory: template code examples

For information, the latest version of MC Factory automatically generate those smarty templates so you can play with it.

Author:  jack4ya [ Tue Sep 21, 2010 3:05 pm ]
Post subject:  Re: Workshop: M&C Module Factory: template code examples

Thanks!  :D

Author:  vinyl [ Sun Jul 03, 2011 12:59 pm ]
Post subject:  Re: Workshop: M&C Module Factory: template code examples

I know it's an old topic but I would like to ask an additional question.

I made a module with some fields to add media. One of them is a dropdown for category. Is there a way to call the module so I can only show content in the category chosen with the dropdown?

Like {my_module category="value"} ?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/