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

I'm trying to use Couch to create a simple way for my colleague to add maintenance events to a public website. It's literally, one page, but each maintenance item is separate. I've set the page to be clonable so each item has its own input under "Maintenance Events".

Each maintenance event will be a separate entry here:

Image

And this is the entry I'm testing with:

Image

This is my code in the head tag:

Code: Select all
<cms:template title='Maintenance Events' clonable='1'>
   <cms:editable name='maintenance_description' type='richtext' />
   
   <cms:editable
     name="maintenance_by"
     label="Maintenance By"
     desc="Who's performing this maintenance?"
     opt_values='Custodian | Third Party'
     type='dropdown'
   />
   
   <cms:editable
     name="maintenance_status"
     label="Status"
     desc="What's the status of this maintenance?"
     opt_values='Scheduled | Open | In Progress'
     type='dropdown'
   />
   
   <cms:editable name='start_date' label='Start Date'
    desc='format DD/MM/YY HH:MM - Please use 24 hour times.'
    type='text' />
   
    <cms:editable name='end_date' label='End Date'
    desc='format DD/MM/YY HH:MM - Please use 24 hour times.'
    type='text' />
   
    <cms:editable name='impacted_services' label='Impacted Services'
    desc='Services which will go down.'
    type='text' />
   
    <cms:editable name='expected_downtime' label='Expected Downtime'
    desc='How long impacted services are expected to be down for.'
    type='text' />
   
    <cms:editable name='at_risk_services' label='At Risk'
    desc='At risk services.'
    type='text' />
   
   
</cms:template>


But, for example, this code:

Code: Select all
<h6 class="text-center"><strong>Maintenance By</strong><br> <cms:show maintenance_by /></h6>


Any ideas what's wrong?
Hello Ashbo,

I'll assume the problem is that
Code: Select all
<h6 class="text-center"><strong>Maintenance By</strong><br> <cms:show maintenance_by /></h6>
is not displaying the expected data.

You stopped short of explaining exactly how you are using the above statement in your template so I can only offer very generic suggestions -

For the <cms:show some_region_name /> to work, the statement needs to be used in context of the cloned page. There are two ways of doing this -
1. Place the statement in the 'page-view' of the template e.g.
Code: Select all
<cms:k_is_page>
   <h6 class="text-center"><strong>Maintenance By</strong><br> <cms:show maintenance_by /></h6>
</cms:if>
So now when a cloned-page is accessed, the data from the page gets shown.

2. Place the statement with cms:pages tag e.g.
Code: Select all
<cms:pages masterpage='whatever_template_name.php' >
   <h6 class="text-center"><strong>Maintenance By</strong><br> <cms:show maintenance_by /></h6>
</cms:pages>

Since, in your case, you seem not to be using individual pages at all and all events get shown on a single page, you should use the second method mentioned above (make sure to set the 'masterpage' to the right template name).

Hope this helps.
Hi KK,

Can you explain a bit on the page/masterpage? What exactly does this do? I'm still trying to get to grips with it all lol!

Cheers mate,
Ash
No worries :)

I suggest you please take a look at our tutorial (http://www.couchcms.com/docs/tutorials/portfolio-site/) - specifically the 'Blog' part. It'll tell you everything that you need to know about these terms.

Let us know if something remains unclear.
That's the guide I was following. I was trying to get the "blog" page, for the front page of the service status page I'm building, rather than the "blog-post" page. If i got to url/index.php?p=1 it shows up correctly, it's just getting it to show on the front page too!

I'll double check and try to find where it's going tits up haha!

Thanks again!
Ash
Okay, I don't see what I'm missing - Had a thorough look but I am on night shifts, to tiredness may have beaten me haha. What code snippets do you need in order to assist?

What I hoped would've been a quick few hours job, has taken me a bit longer and my boss wants me to get this page online by the end of next week :/

Cheers,
Ash
Ash, please zip and PM me all the involved templates and snippets.
I'll try to recreate things on my system and see if I can spot something amiss.

Thanks
7 posts Page 1 of 1