Workshop: M&C Module Factory: template code examples

Discussion about the event, what's going on, room sharing, where to meet up, etc.
Locked
sanderhartveld
Forum Members
Forum Members
Posts: 25
Joined: Mon Sep 07, 2009 10:33 am
Location: Bloemendaal, Netherlands

Workshop: M&C Module Factory: template code examples

Post by sanderhartveld »

Hi Jean-Christophe,
Could you please post some template code examples for using module extender objects.
Thanks, Sander
Last edited by sanderhartveld on Wed Sep 15, 2010 10:13 am, edited 1 time in total.
totophe
Forum Members
Forum Members
Posts: 63
Joined: Wed Feb 21, 2007 9:30 am

Re: Workshop: M&C Module Factory: template code examples

Post by totophe »

First shot :-)

Display_details template example with ModuleXtender calls:

Code: Select all

<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: Select all

{Projects currentpage=1}
or
{Projects options=2}
Last edited by totophe on Wed Sep 15, 2010 10:10 am, edited 1 time in total.
totophe
Forum Members
Forum Members
Posts: 63
Joined: Wed Feb 21, 2007 9:30 am

Re: Workshop: M&C Module Factory: template code examples

Post by totophe »

Show sub modules:

create a filter "parent_item" on the field parent_item

Then inside the parent module template, call:

Code: Select all

{NewsletterSubarticles parent_item=$item->getId()}
totophe
Forum Members
Forum Members
Posts: 63
Joined: Wed Feb 21, 2007 9:30 am

Re: Workshop: M&C Module Factory: template code examples

Post by totophe »

For information, the latest version of MC Factory automatically generate those smarty templates so you can play with it.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: Workshop: M&C Module Factory: template code examples

Post by jack4ya »

Thanks!  :D
vinyl
Forum Members
Forum Members
Posts: 149
Joined: Mon Jul 13, 2009 8:18 pm

Re: Workshop: M&C Module Factory: template code examples

Post by vinyl »

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"} ?
Locked

Return to “Locked: Geek Moot 2010”