THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


I have my content arranges in folders where 'Resources' is the default folder and 'Eating Plan' is the child folder.

How do I get the title of the default folder dynamically? I am editing the content.html but none of the loops offer a straightforward way on getting this information.

I tried this the code below but there is an error I suspect because there is a $TITLE variable already existing from the outer loop.

   
    {loop name="blog.content" type="content" id=$content_id limit="1"}
                {loop type="folder" id=$DEFAULT_FOLDER depth=1}
                    <h1 id="main-label" class="page-header text-center">{$TITLE}</h1>
                 {/loop}
                <div class="chapo">
                    <h3 class="text-center">{$TITLE}</h3>
                </div>
                {if $DESCRIPTION}
                    <div class="description">
                        {$DESCRIPTION nofilter}
                    </div>
                {/if}
        {/loop}

Your help will be highly appreciated

Offline


The folder loop has no name attribute.

Use the development mode to get error messages.


OpenStudio Toulouse

Offline


According to the output on the link below, I can pass the id of the default folder to retrieve the name. Is my code snippet above correct? That would be a good place start when directing a newbie

http://doc.thelia.net/en/documentation/loop/folder.html

Offline


True. However, a "name" attribute is required for every loop. Your folder loop doesn't have one. Try something like

{loop type="folder" name="some-name" id=$DEFAULT_FOLDER depth=1}

depth=1 is not required.

And, once again, work in development mode (http://thelia.net/forum/viewtopic.php?id=11787). You'll get meaningfull error messages directly in your browser


OpenStudio Toulouse