Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hey everyone,

This is a question specifically for @KK and @Cheesypoof, but anyone who thinks they can help is welcome to pitch in :)

So while waiting for the next release, I've hit a rather big bump in the wall. Some of my clients have expressed their confusion at having to go to separate templates (such as a "Global" template) to be able to edit texts that are displayed on a list-view of a template.

I've been trying to figure out some way around this for a while now while trying to convince them to wait for the next release of couch where all of these issues should be gone.

I'm hoping we could fix up a sort of "hacked" solution for now that will make it slightly easier to manage cloned templates list-view editable's within the admin panel.

Would it be possible to use a custom admin list-view for the cloned template in question, where we could add a form above the list of cloned pages that would allow editing of whatever editable's we have for that template? We would still need to define the editable's in a separate template such as globals.php but then would it be possible to edit the contents of those few editable's via the list-view of another template? I've looked into it briefly but could not see an easy way to do it (I'm still not sure it's possible) because of the way the edit pages fetch the template ID of which they're editing among other things.

Any help/ideas are appreciated!
Image
I've stumbled about it too and even suggested to @KK create 'extended templates' thing, similar to 'extended folders'. This is indeed a question to the guys you addressed your post to.

However, there is an easy solution to this.
1st, avoid clonables and put a repeatable if pages/editables count is small. But the essence of my post is devoted to the next one.
2nd, 2 templates do great. This is much better than repeatables, as can be used with clonables. Something like:

template 1: 'portfolio.php' clonable='0' title='Portfolio'. - this one is for home/list-view.
template 2: 'portfolio-items' clonable='1' title='Portfolio - List'. - this one is only for page-view.

Then we don't allow list-view on portfolio-items:
Code: Select all
<cms:if k_is_home >
    <!-- only page view here! -->
    <cms:redirect "<cms:link masterpage='portfolio.php' />" />
</cms:if>


On portfolio.php:
Code: Select all
<cms:pages masterpage='portfolio-items.php' >
  ... your editables from clonable pages
</cms:pages>

Both templates stand close to each other in admin panel. Of course, this is not what you asked for. Maybe your clients are picky and they demand everything to be edited on the same page. Especially if they have a ton of them. But on my recent job i did like that and it looks great!
download.png
download.png (2.23 KiB) Viewed 2685 times



What do you think of it?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Your solution is almost the same as using one global template for all list-view editables (albeit less confusing). While it would be slightly less confusing in navigating the panel, multiple cloned templates would add a LOT of clutter to the sidebar.

The repeatable solution doesn't usually work because most of the time repeatables are a bad alternative to cloned pages (They are not supposed to be one, anyway). The biggest reason is SEO. Others are repeatables get cluttered and hard to manage if they are holding a lot of editables/data within them.

As I'm sure you know... The client is always right :cry:
Some clients usually aren't fussed so long as their site works, however others are very much so and aren't computer literate enough to deal with the somewhat confusing interface
Image
@Bartonsweb, can you then dig into custom edit? I'd love to know how you approaching this to relocate editables from two templates into one view.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
I'm hoping we could fix up a sort of "hacked" solution for now that will make it slightly easier to manage cloned templates list-view editable's within the admin panel.

@Bartonsweb, Have you seen trendoman's idea for creating separators in the admin panel?
viewtopic.php?f=8&t=9887

I think the two together, dedicated list-view templates grouped with their parent template using separators, would make a pretty good stopgap hack until the new admin panel arrives. It would be pretty quick and painless to implement, and addresses your concerns reasonably well for a quick hack.
Would it be possible to use a custom admin list-view for the cloned template in question, where we could add a form above the list of cloned pages that would allow editing of whatever editable's we have for that template? We would still need to define the editable's in a separate template such as globals.php but then would it be possible to edit the contents of those few editable's via the list-view of another template? I've looked into it briefly but could not see an easy way to do it (I'm still not sure it's possible) because of the way the edit pages fetch the template ID of which they're editing among other things.

I don't know how you would modify the admin panel, but using DataBound Forms, you could do something like this, using Couch variables and the pages tag to ferret out page id's.

We'll start with a clonable template called 'globals.php'. Each page of your site can have its own corresponding page in the globals template to hold SEO and whatever else.
Code: Select all
<?php require_once 'couch/cms.php'; ?>
<cms:template title="globals" clonable='1'>   
    <cms:editable
        name='page_title'
        label='title'
        type='text'
    /> 
    <cms:editable
        name='page_description'
        label='description'
        type='text'
    />
</cms:template>

<?php COUCH::invoke(); ?>

Go ahead and create the pages in the globals.php template, giving each the title of the template it serves: index.php, blog.php, gallery.php, etc.

Your DB form on the front end would be placed on the template itself, but only accessible by an admin. Now administrators can fiddle with SEO data right on the page itself.
Code: Select all
<cms:if k_user_access_level ge '7'>
   <cms:set this_title = k_template_name scope='global' />
    <cms:pages masterpage='globals.php'>
        <cms:if k_page_title = "<cms:show this_title/>" >
            <cms:set this_page_id = "<cms:show k_page_id/>" scope='global' />         
        </cms:if>
    </cms:pages>
       
   <cms:form masterpage='globals.php'
       page_id="<cms:show this_page_id/>"
       mode="edit"
       enctype="multipart/form-data"
       method="post"
       anchor="0" >
   
       <cms:if k_success >
           <cms:db_persist_form
            _invalidate_cache='0'
            k_page_title=k_template_name
            />
        </cms:if>
       
      <cms:input type="bound" name="page_title"/>     
      <cms:input type="bound" name="page_description"/>     
      <cms:input type="submit" name="submit" value="submit"/>         
   </cms:form>
</cms:if>
Today i'm giving this interesting topic a second thought. I'm designing a page from scratch with a simple slider (my page is here: link is obsolete, email me for details ). And the template can consist of a gallery to change images in slider. We then create a separate template for the galley images, because it is nice and easy to manage gallery as a separate entity.

I see this topic as a move towards being able to create a 'Panel' of templates, for a certain website page. Let's say, we have this index page, with gallery, portfolio items, contacts etc.
While the 'backoffice' can be of many templates, which is good for programming logic, the 'client office' can be of just one 'Pad' for this page, incorporating editables from different templates, as per choice of the programmer. Extra presentational layer would be of no use for small websites, but helpful for a picky client or a bigger project, and this is gonna be a good tool to learn and study programming side of things. Couch is so much of a entry point to start doing and keep learning.

Couch 2.0 is already coming soon, also with the help of all the people giving support on this forum, but we still have no idea what's on the plate. I'm also sure this is going to be a wonderful release.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
7 posts Page 1 of 1