Important announcements from CouchCMS team
217 posts Page 20 of 22
Previous 1 ... 17, 18, 19, 20, 21, 22 Next
Hello everybody,

I updated CouchCMS from 1.4.7 to 2.0 because I needed sortable clonable pages. Everything works fine except one small issue. I use the following code for a small image gallery on a clonable page:

<cms:repeatable name='referenzbilder' >
<cms:editable type='image' name='bild' label='Bild' width='800' height='528' crop='1' />
</cms:repeatable>

Since I updated to CouchCMS 2.0 the pictures are not resized or cropped anymore. Did the Syntax change? What do I have to change for my field to get resized and cropped images again?

Thank you for your answer.

Best regards,
Thomas
@ThomasSchulte, does this happen in old pages (where images had been already uploaded)? Can you please confirm, that new cloned pages created after upgrade also have this issue. Thanks.
trendoman wrote: @ThomasSchulte, does this happen in old pages (where images had been already uploaded)? Can you please confirm, that new cloned pages created after upgrade also have this issue. Thanks.


I just checked it out. When I create a new cloned page everything works fine.
When I add or change images on the existing pages, resizing and cropping does not happen.
Anything I can do with my old pages to make it work again?
I suspect, that changing old image is tricky - first remove old image, save page. Then step 2 - add new image and save page normally. On step 2 everything should work, I guess, since it will look like a new cloned page.
@ThomasSchulte, I used your exact code on my system (v2,0 from GitHub) but could not replicate the issue.
The cropping was being done under all circumstances.

If you are not already using it, could you please try upgrading to the current GitHub version of Couch (https://github.com/CouchCMS/CouchCMS) and see if that solves the issue for you?

Hello everybody

With version v1.4.7 I implemented some sort of application logic to trigger mails to customers etc. Now I tried to achieve this with version v2.0 using config_list_view and config_form_view and not needing to use snippets. As an advantage all application logic lies inside the template files. As an example see here an example mailer app. One can send mails to a list (clonable template) of recipients. It consists of the basic concepts I used in my larger application in v1.4.7.

While implementing I struggled with the functionality with these new concepts, namely:
- Application logic within config_form_view must be within a field tag. Outside nothing is executed.
- I had to use placeholder fields to implement application logic and output formatted html, e.g. bootstrap rows and cols.
- I had to hide (skip='1') all fields outputted manually in order that they do not appear twice
- The tag do_shortcodes worked only when placing it within the send_mail tag. Outside, e.g. within the pages tag, it did not work.
- Fields outputted used to hold the chosen action and the selected items of the list had to be stored (persist tag at the beginning of config_form_view) from the temporary fields (with added frm_). An at the end I had to empty these fields again (db_persist).
- Since no code is executed outside field tags and within persist tag it is not possible to make some minimal app logic as follows:
Code: Select all
<cms:set name="<cms:random_name />" scope='global' />
<cms:persist
   k_page_name="<cms:if k_page_name==''><cms:show name /><cms:else/><cms:show k_page_name /></cms:if>"
   k_page_title="<cms:if k_page_name==''><cms:show name /><cms:else/><cms:show k_page_title /></cms:if>"
   _auto_title='1'
/>

Instead I had to do it the following restricted way:

Code: Select all
<cms:persist
   k_page_name="<cms:if k_page_name==''><cms:random_name /><cms:else/><cms:show k_page_name /></cms:if>"
   k_page_title=k_page_name
   _auto_title='1'
/>

But it actually works. Does anyone has Ideas to make the code more slick and clean? Or to find a better solution to the mentioned constraints?

The attached file uses a minimal bootstrap grid. It is added within the template "bootstrap". So change setting number 26 on config.php. Also add the snippeds for shortcodes in the kfunctions.php.


I would be glad to have the best possible solution before rewriting the code for v2.0 of my extended application.

Attachments

Now I tried to achieve this with version v2.0 using config_list_view and config_form_view and not needing to use snippets.

@olliwalli, trying something "not needing to use snippets" for a complex use-case would only amount to placing unnecessary limitations on yourself.

'config_list_view' and 'config_form_view' are fine for tweaking the respective admin screens.
For anything more than that (as in your use-case), I think it'd be much easier to simply override the complete screens and then you can put in there all the application logic you wish. In a way, the process will then becomes akin to coding the front-end templates.

To do that, you may either choose the older 'Custom admin screens' (described in the first post of the current thread) or may use the newer 'theme overriding' method (an example can be found here - viewtopic.php?f=2&t=10438&p=25693#p25693).

Hope it helps.
KK wrote: I think it'd be much easier to simply override the complete screens and then you can put in there all the application logic you wish. In a way, the process will then becomes akin to coding the front-end templates.

I second this.

Coding the logic in some sort of front-end is fun, clean and maintainable in the long run.
trendoman wrote:
KK wrote: I think it'd be much easier to simply override the complete screens and then you can put in there all the application logic you wish. In a way, the process will then becomes akin to coding the front-end templates.

I second this.

Coding the logic in some sort of front-end is fun, clean and maintainable in the long run.


Thanks for the input. Yes, probably it is better to override the screens instead of packing all into the template files. I just read the post viewtopic.php?f=2&t=10438&p=25693#p25693 about selectively overriding template parts with a custom backend template. This is a great solution - Thanks! I think I will follow this path since I can selectively put in the application logic for each template.
Congratulations on the v2.0 release! The new admin section configurability is great!
Previous 1 ... 17, 18, 19, 20, 21, 22 Next
217 posts Page 20 of 22

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 1 guest

cron