[solved] Server Side Includes

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
jlkane

[solved] Server Side Includes

Post by jlkane »

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
Last edited by jlkane on Sun Mar 08, 2009 4:38 am, edited 1 time in total.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Server Side Includes

Post by spcherub »

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
jlkane

Re: Server Side Includes

Post by jlkane »

Thanks!  Will investigate and give those methods a try.

Jim
Pierre M.

Re: Server Side Includes

Post by Pierre M. »

Hello,
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
This breaks my mind. How a real rollover nav isn't CSS based ?

Pierre M.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Server Side Includes

Post by Dr.CSS »

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...
Pierre M.

Re: Server Side Includes

Post by Pierre M. »

Ah I understand. Something that needs the downloading of some codec plugin to play :-)
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Server Side Includes

Post by Dr.CSS »

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...
Last edited by Anonymous on Fri Mar 06, 2009 7:00 pm, edited 1 time in total.
jlkane

Re: Server Side Includes

Post by jlkane »

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
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Server Side Includes

Post by spcherub »

So back to your original question...  :)

Did you figure out a way to include your source?
jlkane

Re: Server Side Includes

Post by jlkane »

spcherub wrote: So back to your original question...  :)

Did you figure out a way to include your source?
No, but thanks for bringing us back to topic!  (Fortunately, I opened this question early in implementation of CMSMS, so I'll be okay.)

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
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Server Side Includes

Post by tyman00 »

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.
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.
jlkane

Re: Server Side Includes

Post by jlkane »

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.
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.

Jim
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Server Side Includes

Post by tyman00 »

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)
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.
jlkane

Re: Server Side Includes

Post by jlkane »

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
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: [solved] Server Side Includes

Post by spcherub »

If you are doing JS in GCBs then remember to put everything between literal} {/literal} tags otherwise the smarty engine will scream bloody murder!
Locked

Return to “CMSMS Core”