HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Adding extra CSS style sheets to a theme in v9

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#99944 (In Topic #19618)
Avatar

Community saint

Ok so I have some extra CSS style sheets I am adding to a theme. In my gloabal_html_wrap.tpl I have added the styel sheet reference as such

Code

<link rel="stylesheet" href="{$BASE_URL*}/themes/rep2/css/html5reset.css" media="all">

While this works this is obviously not the best method but I tried
just

Code

{$REQUIRE_CSS,'html5reset'}

and

Code

<link rel="stylesheet" href="{$REQUIRE_CSS,'html5reset'}" media="all">

both of which give me erros so what is the correct method?
Back to the top
 
Posted
Rating:
#99945
Avatar

Code

{$REQUIRE_CSS,html5reset}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#99962
Avatar

Community saint

I actually had that originally and it gave me some errors about converting float to string? That's why I put quotes around it.

I think cause some of the CSS files are name 1024.css and 720.css etc
Back to the top
 
Posted
Rating:
#99972
Avatar

Ah right.

PHP has this weird thing where it converts numeric-strings to integers if they are used as array keys. To fix ocPortal to workaround, in sources/global2.php:

Code

   foreach ($css_to_do as $c)
   {
–>

Code

   foreach ($css_to_do as $c)
   {
      if (is_integer($c)) $c=strval($c);

Or for now I'd just put a string prefix on your CSS filenames ;).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#99981
Avatar

Community saint

Thanks yeah that sorted it out. Well I used is_numeric instead but I like it better than having to sort through all the CSS and JS files related to the theme to switch to strings.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: