Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello Kamran happy new year!

Long time no new website but now I'm on again and struggling with listing pictures from folders related to some pages of another template.

What I want to achieve:
I want to make a listing of pictures which can be listed on the one hand by product category and on the other hand by the material they are made of.

Therefore I created a gallery and a clonable template "material.php". The folders of the gallery can be related to the pages of the material template by using the extended folders:

Code: Select all
<cms:template title='Bilder Galerie' clonable='1' dynamic_folders='1' gallery='1' order='20' folder_masterpage='galerie-folders.php'>
xxx
</cms:template>


galerie-folders.php looks like this:

Code: Select all
<?php require_once( 'cms/cms.php' ); ?>
<cms:template title='Galerie Folder' clonable='1' hidden='1' order='100'>

<cms:editable
    name="related_material"
    label="Material"
    opt_values='material_liste.php'
    dynamic='opt_values'
    type='dropdown'
    desc='choose your material'
/>

</cms:template>
<?php COUCH::invoke(); ?>


material_liste.php is a snippet which looks like this
Code: Select all
Choose material
<cms:pages masterpage="material.php">
   | <cms:show k_page_title  /> = <cms:show k_page_name />
</cms:pages>


Now with this relation in place I go to my gallery template galerie.php
and create the first list for the folders of the gallery were I can list the products by category folder:
Code: Select all

<h4>Kategorie</h4>                 
<ul>
<li><a href="<cms:link masterpage='galerie.php' />#galerie" title="All pictures"><strong>All Pictures</strong></a></li>
<cms:folders depth='1'>
<li><a href="<cms:show k_folder_link />#galerie" title="<cms:show k_folder_title />"><cms:show k_folder_title /></a></li>
</cms:folders>
</ul>


This is working as intended.

Now I want to create a second list with the materials
Code: Select all
<h4>Material</h4>                
<ul>
<cms:pages masterpage='material.php'  >
<li><a href="<??? no idea how to create the link here???>" title="<cms:show k_page_title/>"><cms:show k_page_title/></a></li>
</cms:pages>
</ul>


I have no clue how to create the link above to show the pictures related to one kind of material in the list view. Should I make a variable out of the "related_material"? But then I need a additional submit button, right? Or is there another easy option I cant see.

At the moment the pictures are listed like this for the categories but I guess there also have to be made changes to use it to show the pictures related to the materials.

Code: Select all
<cms:pages masterpage='galerie.php' folder="<cms:show k_folder_name/>">
     <li>
        <figure>
            <a href="<cms:show gg_image/>" data-lightbox="<cms:show k_folder_name/>x" title="<cms:show k_page_title/>">
            <span class="thumb-screen"></span>
            <img src="<cms:show gg_thumb/>" alt="<cms:show k_page_title/>"/>
            </a>
            <figcaption>
            <cms:show k_page_title/>
            </figcaption>
        </figure>
    </li>
</cms:pages>


Thank you very, very much for your help!
Hi Christoph,

Sorry for getting back so late (and thanks for responding to my PM and granting me time to attend to this thread).
I finally found the time to take a deeper look at the problem you mentioned.

I'd like to ask you a few things that I found difficult to wrap my head around.

From what I understood -
1. Each image would be in a folder (e.g. 'Kitchen' or 'Stairs')
2. And, from how you have setup the templates, each folder would be related to one single material (e.g. 'Kitchen' would be related to 'Marble' or 'Granite'). You have set this up as galerie-folders.php to materials.php.

The second point above doesn't make sense to me -
how can 'Kitchen' be related to only one material? I think what you'd want is to make an 'image' within 'kitchen' (and not the entire kitchen folder) be related to a single material.

So an image would be -
1. related to a folder (e.g. kitchen or stairs)
2. related to a material (e.g. marble or granite)

And now you can list images by 'folders' and by 'materials'.

Am I wrong in my understanding?
Please let me know.
My idea was that the user uploads a bunch of pictures in a project gallery. Lets name it "whithe stair" these folder "white-stair" will be in a subfolder lets name it 'indoor projects'. What I want is, that in the end the visitor of the website can list the pictures like indoor and outdoor projects, and if looking for a special material, that he can list all projects were a special kind of material is used (eg Marble).

To your question: A kitchen or a stair can be made out of one kind of stone material and I'm only after the stones.

But of course it would be better to relate each image to a material and a project. The only point is here that you have to tag each uploaded image with a material and the other way you only have to tag the project folder with one material.

But I would be happy with any kind of solution. To solve my problem.
3 posts Page 1 of 1
cron