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.


Embeding a FILENAME.php

Login / Search

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

Well-settled

That'e the best why to handle this.

Hi , guys I am at odds on what's the best way to embed a php file and it's location (directory) I.E
sources_custom, I've been reading alot trying to figure this out on my own. I know I can

<!– INCLUDEPHP .sources_custom/.php –>

or something like

<!– PHP –>

in a comcode page

<!– ENDPHP –>

I want the script (I have the script) to display as an image background on the welcome page without using global.css or any .css file

All the OCP reading just got me more confused? I am sure I may understand what I read someday, but not today.

How can I embed or include scripts into OCP?

Or
in the Global.css

background: url('{$IMG}') can this be something like

background: url('{$IMG,$IMG1,$IMG3,$IMG3,}') with the image in the $IMG tag rotate on every page load?



Thanks
Back to the top
 
Posted
Rating:
#64037
Avatar

To include a PHP script, put it in sources_custom/miniblocks and then you can use it as a block.

You can also do…

background: url('{$IMG,{$SET_RAND,img_code_1,img_code_2,img_code_3,...}}')
as long as you put that in no_cache.css.


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:
#64398
Avatar

Well-settled

No matter how I try the above


background: url('{$IMG,{$SET_RAND,img_code_1,img_code_2,img_code_3,…}}')
I can't make it work the above code with img_code_3,}}')

generates an error I remove the … and nothing happens other than the error is gone now.

Some farther help is need please.
Back to the top
 
Posted
Rating:
#64404
Avatar

The "…" was just illustrative to show you can add any number of images codes.

An example might be:

Code

.example {
background: url('{$IMG,{$SET_RAND,expand,contract}}')
}

That chooses randomly between two theme images in the default ocPortal theme: expand and contract, and makes it the background for something with class="example".

Testing here to see if that works (won't work for you to test here, as I'm using my admin privileges)…
.example { background: url('{$IMG,{$SET_RAND,expand,contract}}') } test


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:
#64442
Avatar

Well-settled

Sorry can you please tell me where exactly where to add this, I tried this but how should the class="example" be used at in the global.css

Thanks for the hand holding.
Back to the top
 
Posted
Rating:
#64450
Avatar

It has to be the 'no_cache' CSS file, not 'global'.

As for class="example", that would need to be in the HTML, which would probably be a template. To be honest I don't really have time to explain, but we do have a markup tutorial that explains how CSS and HTML works.


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:
#64454
Avatar

Well-settled

OK, well thanks for your time and your help.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: