Forum for discussing general topics related to Couch.
20 posts Page 2 of 2
Hello Trendoman,

Thank you for.the response. I have saved in php and appended all that needs to be appended.

see the codes below:

1. this was placed inside of the CSS file

Code: Select all
<?php require_once( 'couch/cms.php' ); ?>

<cms:content_type 'text/css' />   


.............................................

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


2. this was placed in the head of the html file:

Code: Select all

<link rel="stylesheet" href="<cms:show k_site_link />css/web.php?v=<cms:show k_page_modification_date />" type="text/css">



Thanks
Last 2 steps - (1) edit the line to correctly set the path. I am certain your couch folder is outside the /css folder. A couch-managed template must be properly registered
Code: Select all
<?php require_once( '../couch/cms.php' ); ?>

(2) Visit domain/css/web.php as superadmin.
Does it help?
wow, Trendoman, yes it does help.

I am able to load it now. Thank you very much.

Can you refer me to a comprehensive topic where I can read more about defining editable regions on the CSS if there's any?

Thank you.
You are welcome.

Regarding other threads - nothing special here or at least I couldn't spot one for you.

I am still not clear about your plans - are you giving an admin a way to edit the CSS directly in backend (as in a notepad) or allow only to tweak some params via a set of radio buttons?
Thanks Trendoman,

I will be giving an admin the rights to make changes to certain portion of the styling, no doubt. However, I also want to be able to apply some logical coding onto the stylesheets to affect some component part of the pages.

Is that achievable at this instance?
Since your css is now a full fledged couch-powered template - you can use any tags and build any kind of logic there. Wish you best in your experiments.
Hi, I'm facing an issue with allowing some css attributes to be edited via the admin panel and I was wondering if you would be able to shed any light on this for me? I've been through a few threads and cobbled together a small php template from the examples / previous comments but not having any joy getting it to work.

The following is my php template, located in <my_url>/assets/css/
The couch files are all in <my_url>/cms_manager/

I am getting a 500 error on my php template and the template isn't appearing in the admin panel so I've probably done something daft but have spent so long staring at it I can't see it.

Code: Select all
<?php require_once( '../cms_manager/cms.php' ); ?><cms:content_type 'text/css' />
<cms:template name='theme_colours' title='Theme Colours' order='5'>
    <cms:editable label='Main Gradient Colour ' name='colour_2' type='text' order='1'/>
    <cms:editable label='Gradient Colour 1' name='colour_1' type='text' order='2'/>
    <cms:editable label='Gradient Colour 2' name='colour_3' type='text' order='3'/>
</cms:template>
:root {
   --color1:  <cms:show colour_1 />;
   --color2:  <cms:show colour_2 />;
   --color3:  <cms:show colour_3 />;
}
<?php COUCH::invoke(); ?>
@nick, you mentioned -
..my php template, located in <my_url>/assets/css/
The couch files are all in <my_url>/cms_manager/

Going by that info, since the template in question lies two folder deep from the site's root, the correct path given to 'require_once' would be this -
Code: Select all
<?php require_once( '../../cms_manager/cms.php' ); ?>

Hope this helps.
Yep, that's got it. Thank you so much for spotting that before I tore all my hair out!
You are welcome :)
20 posts Page 2 of 2
cron