[solved] Server Side Includes
[solved] Server Side Includes
I regularly build non-CMS sites (horrors, I know!) and I use SSI (Server Side Includes) to simplify my life: I include scripts in the section, preload rollover button images, etc.
For my first CMSMS site, my client insists on a real rollover nav bar -- not a CMS-driven CSS nav bar -- to provide the best visual design, and I would like to retain the benefits of SSI for the implementation. Is it possible to use SSI -- or something similar -- in the of a CMSMS template?
Thanks in advance,
Jim
For my first CMSMS site, my client insists on a real rollover nav bar -- not a CMS-driven CSS nav bar -- to provide the best visual design, and I would like to retain the benefits of SSI for the implementation. Is it possible to use SSI -- or something similar -- in the of a CMSMS template?
Thanks in advance,
Jim
Last edited by jlkane on Sun Mar 08, 2009 4:38 am, edited 1 time in total.
Re: Server Side Includes
If you are familiar with PHP you can always use the "include" (http://us.php.net/include/) or "require" (http://us2.php.net/require) functions to pull code from their files into the current script.
With CMSMS you will need to embed this call in {php}{/php} tages or you can write a UDT (User Defined Tag) to performa the include. See http://wiki.cmsmadesimple.org/index.php/Developers_FAQ for more information.
Hope this helps.
S
With CMSMS you will need to embed this call in {php}{/php} tages or you can write a UDT (User Defined Tag) to performa the include. See http://wiki.cmsmadesimple.org/index.php/Developers_FAQ for more information.
Hope this helps.
S
Re: Server Side Includes
Hello,
Pierre M.
This breaks my mind. How a real rollover nav isn't CSS based ?jlkane wrote: For my first CMSMS site, my client insists on a real rollover nav bar -- not a CMS-driven CSS nav bar -- to provide the best visual design
Pierre M.
Re: Server Side Includes
Well it should be flashed based and so complicated the end user will have to hire a technician to change it, other wise it's not real...
Re: Server Side Includes
Ah I understand. Something that needs the downloading of some codec plugin to play 

Re: Server Side Includes
And is totally non accessible to anyone with a disability of any kind, and non standards compliant and is only usable in ie6/7 and includes all kinds of onclick, mouseover, mouseout, yada yada ya...
Cant just be image for normal state, image for hover...
Wondering how the menu on my site is not real?....
Must be a mass hallucination...
Cant just be image for normal state, image for hover...
Wondering how the menu on my site is not real?....
Must be a mass hallucination...
Last edited by Anonymous on Fri Mar 06, 2009 7:00 pm, edited 1 time in total.
Re: Server Side Includes
Wow... I never expected a flame war to erupt over the idea of using a JavaScript rollover-based nav bar. Not Flash, no codecs required... just the kind of simple rollover that predated the CSS-based pseudo-rollovers that CMSMS takes as standard operating procedure. Highly compliant and cross-browser compatible ...just a little "old-fashioned."
Jim
Jim
Re: Server Side Includes
So back to your original question... 
Did you figure out a way to include your source?

Did you figure out a way to include your source?
Re: Server Side Includes
No, but thanks for bringing us back to topic! (Fortunately, I opened this question early in implementation of CMSMS, so I'll be okay.)spcherub wrote: So back to your original question...
Did you figure out a way to include your source?
Might Global Content Blocks be the answer? The documentation on GCBs is sparse, so I'm not sure what's possible. I'm sure they're intended to enable re-use of "real" content -- chunks of text and other content that might want to reappear multiple times within a site -- but could I use one to "include" big chunks of JavaScript in the sections of multiple templates?
Jim
Re: Server Side Includes
Why you wouldn't want a dynamic menu that is also Cross-Browser compatible and accessible is beyond me. Calling your old school roll-over option a real navigation vs. a dynamic CSS nav is why I suppose they were getting on your case.
You can still have a dynamic menu, have it CSS based and have roll over images. That way you satisfy your clients needs and you are actually using a menu that could be considered "real". If you are still set on doing it the old hard way you can just build it into your page template like you would have built that menu into a standard html page.
You can still have a dynamic menu, have it CSS based and have roll over images. That way you satisfy your clients needs and you are actually using a menu that could be considered "real". If you are still set on doing it the old hard way you can just build it into your page template like you would have built that menu into a standard html page.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Re: Server Side Includes
Let's side-step the discussion of CSS-driven menus vs. image swaps -- please accept for the moment that my client insists on using a unique font that forces me to use an image swap. Yes, I can just drop that load of code -- the JavaScript, the image preloading and all -- into each template I build, but MY goal is to simplify the coding of multiple templates. That's why I normally use an "include" mechanism for those re-usable chunks ...and why I'm looking for the right mechanism to use in the CMSMS environment.tyman00 wrote: If you are still set on doing it the old hard way you can just build it into your page template like you would have built that menu into a standard html page.
Jim
Re: Server Side Includes
That makes sense (if you'd have mentioned that earlier... a lot of this would have been avoided
) If you are going to have multiple templates I would use a GCB. Essentially just load all of your JS and your Menu code/html into the the GCB. Then in your templates just call {global_content name= 'menu'} and it will insert the code from your Menu GCB in that area much like an include would.
If you want to do two separate GCB's (one for html one for JS) you can do this as well. You are on the right track. Sorry your client is limiting you and causing you to drop one of the better features of CMSMS (dynamic menus)

If you want to do two separate GCB's (one for html one for JS) you can do this as well. You are on the right track. Sorry your client is limiting you and causing you to drop one of the better features of CMSMS (dynamic menus)
Last edited by tyman00 on Sun Mar 08, 2009 4:07 am, edited 1 time in total.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Re: Server Side Includes
Thanks for the confirmation, Tyman. Now I'll go forth and try some GCBs.
Yes, my client's insistence on an image swap rollover is unfortunate, but I've at least got a livable compromise: we'll use an image swap rollover only to create the prettiest-possible top-level nav bar -- it shouldn't change much over time, so the pain will be limited -- but we'll use nice (standard) dynamic CSS menus for the interior section menus that will change more often. With luck, the best of both worlds...
Thanks for your help,
Jim
Yes, my client's insistence on an image swap rollover is unfortunate, but I've at least got a livable compromise: we'll use an image swap rollover only to create the prettiest-possible top-level nav bar -- it shouldn't change much over time, so the pain will be limited -- but we'll use nice (standard) dynamic CSS menus for the interior section menus that will change more often. With luck, the best of both worlds...
Thanks for your help,
Jim
Re: [solved] Server Side Includes
If you are doing JS in GCBs then remember to put everything between literal} {/literal} tags otherwise the smarty engine will scream bloody murder!