Welcome to the THELIA support and discusssion forum


Rejoignez la communauté sur le Discord Thelia :


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>
                <div class="chapo">
                    <h3 class="text-center">{$TITLE}</h3>
                {if $DESCRIPTION}
                    <div class="description">
                        {$DESCRIPTION nofilter}

Your help will be highly appreciated


The folder loop has no name attribute.

Use the development mode to get error messages.

OpenStudio Toulouse


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


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 ( You'll get meaningfull error messages directly in your browser

OpenStudio Toulouse