AdvancedContent and Content Dump

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
moonoo
Forum Members
Forum Members
Posts: 77
Joined: Fri Jan 08, 2010 12:23 am
Location: Wales - UK

AdvancedContent and Content Dump

Post by moonoo »

Thinking of using AdvancedContent to enable more flexible content insertion in pages..

But would love to use Content_Dump plugin to showcase Projects on the home page..

Could anyone point me in the right direction to finding the values of the fields I create in

i.e

Code: Select all

{AdvancedContent block="images" label="Select your beloved images" block_type="select_multiple" items=":::list_files dir='images':::" values=":::list_files dir='images' display='relurl':::" smarty="true" assign="images"}
{assign var="img_array" value='|'|explode:$images}
{foreach from=$img_array item="image"}
{if $image !=""}
<img src="{uploads_url}/{$image}" />
{/if}
{/foreach}
So question is.. what syntax would I be using to target the first image in the array, so I could use it as an image on home page as a summary of the page content.. possibly along side the Page title in question and a brief summery text field.

{content_dump}

{foreach from=$dump item=dump}
 {$dump->content->data}
{$dump->content->alias}
{$dump->extensions->video}
{/foreach}

Any pointers here?
Last edited by moonoo on Tue Oct 19, 2010 5:12 pm, edited 1 time in total.
NaN

Re: AdvancedContent and Content Dump

Post by NaN »

I didn't use content_dump yet. But to get the first item of an array inside a foreach loop use the smarty var "first".
Example:

Code: Select all


{foreach from=$someArray item=itemInsideTheLoop name=someName}

   {if $smarty.foreach.someName.first}

      do whatever you want to do with the first item

   {/if}

   ...

{/foreach}

moonoo
Forum Members
Forum Members
Posts: 77
Joined: Fri Jan 08, 2010 12:23 am
Location: Wales - UK

Re: AdvancedContent and Content Dump

Post by moonoo »

Cool,

Getting there:

I have been using this plugin: http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/

Demo here https://buildinternet.s3.amazonaws.com/live-tutorials/sliding-boxes/index.htm


To manipulate the output...

Here's what I have so far for the template..

Just need a way of finding the vars for the AdvancedContent blocks I create..

Code: Select all

{content_dump limit_count=10 first_sort=”created” exclude="60,61" first_sort_order=”down” extensions="image,project_description" start_id="62" depth="3,3"}
  {foreach from=$dump item=dump}
<div class="boxgrid captionfull">
<img src="{uploads_url}/images/{$dump->extensions->image->data}" width="200" />
<div class="cover boxcaption">
   <h3>{$dump->content->title}</h3>
   <p>
    {$dump->extensions->project_description->data}
   <a href=/index.php?page={$dump->content->alias}>See: {$dump->content->title}</a>
</p>
</div>
</div>
  {/foreach}
Post Reply

Return to “Modules/Add-Ons”