Important announcements from CouchCMS team
237 posts Page 10 of 24
Previous 1 ... 7, 8, 9, 10, 11, 12, 13 ... 24 Next
I skimmed through the new features, and was curious about if something is possible, and had one other question.

Right now, I have a custom field "Chapter" which is a decimal number, (1, 2, 3, 3.5, 4, 5, etc)

Is it possible to customize the view in the admin panel to display that field (only if it exists), and expose the up/down arrows and have it affect that field in 0.5 intervals rather than weight?

The other question is, if I download the current git repo as a zip (not the release) is that the 2.0 line or the 1.4 line?
Trel wrote: The other question is, if I download the current git repo as a zip (not the release) is that the 2.0 line or the 1.4 line?

Hi, @Trel it's 2.0 there, as this is going to be the main line.

expose the up/down arrows and have it affect that field in 0.5 intervals rather than weight?

If you need to increase-decrease the values in the editable field, than a simple input type='number' can be of help, because it has an option `step` (google for it). Regularly, up-down is reserved for manual sorting the pages in admin panel, please make it more clear if you want to sort pages by increasing-decreasing interval.
In my narrow view, nested_pages concept for arranging chapters in a book is good for this without dependance on some changeable number.
trendoman wrote: In my narrow view, nested_pages concept for arranging chapters in a book is good for this without dependance on some changeable number.


I agree, except with nested pages, the pretty URLs can't end in .html, which I do want them to do.
Howdy KK!

So I know Couch doesn't officially support PHP 7 yet, but I wanted to let you know, currently, even with the PHP 7 patch posted earlier, Couch can't be installed. Apparently install.php uses the function errno which has been removed. According to the PHP documentation, mysqli should be used instead.

Just wanted to give you a heads-up :)

Thanks for all the work you do!
Hi @Mako88 :)

This problem was discussed at -
https://www.couchcms.com/forum/viewtopi ... 225#p25225

You may also download the patch at viewtopic.php?p=25072#p25072 again as it now contains the fix.

Hope it helps.
Yeah, that worked! Thank you very much! :)
Hi, apologies if I've missed something, I had a look through to see if this had been explained/asked, but I couldn't find it.

My question is, when I am adding the manual configuration code to a template in couch, I would like to be able to make any one of the available fields a link to edit the record. It seems that the k_page_title field does this automatically. However, when I am accessing records from a databound form with auto_title on (a random string is the title), I don't want to display the title.
For example in this basic contact form I want to display:
Code: Select all
<cms:config_list_view>
    <cms:field 'k_selector_checkbox' />
    <cms:field 'your_name' header='Name' ***I would like something like edit_link='1'*** />
    <cms:field 'your_email' header='Email' />
    <cms:field 'k_page_date' />
    <cms:field 'k_actions' />
</cms:config_list_view>

I would like to make the 'Name' field a link to edit the record. Is there a way to do this?
Thanks in advance!
@ewanmc,
As mentioned in the introductory post, if we use the <cms:field> tag as a 'tag-pair', it makes it display anything that is enclosed within the pair e.g. the follows will always display 'hello!' -
Code: Select all
<cms:field 'your_name' header='Name' >
   hello!
</cms:field>

As also mentioned, the enclosed content is executed dynamically i.e. if it has regular Couch tags those would be parsed and executed just the way we see on the frontend templates.

So, for example, the following would always show the title of the page -
Code: Select all
[code]<cms:field 'your_name' header='Name' >
   <cms:show k_page_title />
</cms:field>[/code]

Which brings us to your immediate question (how to display the edit link).

One way would be to craft the edit link manually and display it.
Another would be to see if Couch already makes this link available and, if so, use it.

On a frontend template, to know exactly which variables are available at any point we can, as I am sure you know, we can place <cms:dump /> or <cms:dump_all /> tag at that point and this gives us a list of all the available variables.

We can do exactly that with the backend templates too. So, if we were to make your code as follows it will show you the entire list of variables at your disposal at that point (i.e. while displaying your field) -
Code: Select all
[code]<cms:field 'your_name' header='Name' >
   <cms:dump_all />
</cms:field>[/code]

In the list, you'll notice that there is a variable named 'k_update_link' that gives us the link to the edit screen of the page being iterated.

Use it in your code as follows and now you have the edit link you wanted -
Code: Select all
<cms:field 'your_name' header='Name' >
    <a href="<cms:show k_update_link />" >
        <cms:show k_page_title />
    </a>
</cms:field>

Substitute k_page_title to whatever you want to use as the text - I think it would be the 'your_name' field
Code: Select all
<cms:field 'your_name' header='Name' >
    <a href="<cms:show k_update_link />" >
        <cms:show your_name />
    </a>
</cms:field>

Hope it helps.

P.S. Make sure to visit the frontend template as super-admin each time you modify the code for it to be persisted.
@kk,
Thanks as ever for a great explanation!
I'd missed the significance of the tag-pairs to display whatever I wanted here. I had vaguely attempted to craft the link manually, but I hadn't realized I could use <cms:dump/> in the back-end to check the variables!
I feel like I'll always be learning Couch.... :?
Thanks again!
If I wanted to upgrade my install to 2.0 right now, is it recommended to use the attachment in the first post or to download a clone of the github repo?
Previous 1 ... 7, 8, 9, 10, 11, 12, 13 ... 24 Next
237 posts Page 10 of 24