Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi,

First, thanks for couch ! I use it for many years... ant the evolution is great !!
I have few question...

There is projects with gallery and each projet have a categorie

- Photo
-- project photo 1
-- project photo 2

- Peinture (painting)
-- project peinture 1
-- project peinture 2

- Dessin (drawing)
-- project dessin 1

1 project = 1 gallery + 1 description global + 1 image global + 1 categorie

In admin, i need to manage categories : add/delete/sorts (Photo/Peinture/Dessin/...)
and to add project and choose categorie for this project.


I tried several things :

1. With repeatable

projets.php
Code: Select all
<cms:template title='Projets' clonable='1'>
   <cms:editable type='relation' name='projets_categories' masterpage='categories.php' has='one'/>
   <cms:editable name='projet_description' label='Description du projet' type='richtext' />
   
   <cms:repeatable name='my_gallery' >
           <cms:editable name='my_img' label='Image' type='image' show_preview='1' />
        <cms:editable name='my_img_caption' label='Legende' type='text'  />
      <cms:editable name="my_picto" label="Pictogramme"  opt_values='Oui' type='checkbox' />
   </cms:repeatable> 
   </cms:template>


categories.php
Code: Select all
 <cms:template title='Categories' clonable='1' order='5' icon='menu'>
   </cms:template>


couch_forum.jpg
couch_forum.jpg (43.54 KiB) Viewed 290 times

It's perfect : when i create a project i can choose my categorie
BUT... I have to upload images one by one


2. With gallery
Code: Select all
 <cms:template title='Projets2' clonable='1' dynamic_folders='1' gallery='1'>
         <cms:editable name="gg_image" ...
   [...]
   </cms:template>


In admin, i create empty gallerys for the categorie, then projects in each categories.

couch_forum-3.jpg
couch_forum-3.jpg (37.92 KiB) Viewed 290 times


I don't find it intuitive for the client :
For add a project
- one click for the template (left menu in admin)
- one click on "manage folder"
- one click for "add new"
and for create a new categorie...
and i didn't find how use "k_up_down" in the list folder view (admin). it's possible ?
(for sort categorie and sort projet in a categorie...)


3. The ideal solution :
- simple management of categories with a clonable page.
- use gallery for massive upload AND a custom view of folder's administration for assignate a categorie (with a dropdown like in the first solution)

is it possible to use "config_form_view" and relation for gallery's folder ? (and not for each image...)

Would you have some advice ?

Thanks and sorry for my bad english :?
Hi :)

I suggest you please try the following -

1. Use a clonable template (projects.php) for projects.
2. Instead of using a separate template for categories, use the 'folders' of projects template itself to create the category hierarchy.
3. For the large number of images, use a separate gallery template (gallery.php) and link it to products.php as shown in the following thread -
viewtopic.php?f=8&t=8559

Your product.php should now look something like this -
Code: Select all
<cms:template title='Projets' clonable='1' dynamic_folders='1'>
   <cms:editable name='projet_description' label='Description du projet' type='richtext' />
   
    <cms:editable
        type='reverse_relation'
        masterpage='gallery.php'
        ..
        ..
    />
</cms:template>

By using 'reverse_relation' as shown above, it should be very manageable for the client to have a full-fledged gallery for each individual product page.

Would this help? Do let me know.
Hi,

I followed your advice and it works... but i did not manage to customize admin folder list view and admin folder form view :(
So i kept another clonable page for my "category"... and it's fine.

Thanks !


Code: Select all
<!-- in project.php -->
<cms:template title='Projets' clonable='1' >
   <cms:editable name='projet_description' label='Description du projet' type='richtext' />
   <cms:editable type='relation' name='project_categories' masterpage='categories.php'  has='one'/>
   <cms:editable type='reverse_relation' name='project_photos' masterpage='gallery.php' field='photo_project' anchor_text='Voir les images' label='Images du projet' />
</cms:template>



Code: Select all
<!-- in gallery.php -->
<cms:template title='Galerie' clonable='1' dynamic_folders='1' gallery='1' hidden='1'>
        <cms:editable type='relation' name='photo_project'  masterpage='project.php'  has='one' no_gui='1' label='-' />
   <cms:editable name="gg_image"  ... />
        [...]
</cms:template>



Code: Select all
<!-- in categories.php -->
<cms:template title='Categories' clonable='1'></cms:template>
3 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests