Includes & Headers

Hi Guys,

 

I may be in the wrong section, but I'm pretty sure this is not a bug.  That said, the sub_header file in the template does not seem to be functioning properly when it comes to includes.

 

Case in point:  Was making a few custom additions to the subheader in Templates folder and decided to include a file versus adding the code directly to the sub_header file.  Make a long story short, I ended up creating an extremely simple include file which still did not include.

 

Issue:  Eventhough sub_header is an html page, it still should take includes, but it's not.

 

Ex:  Templates/newTemplate/subheader.html

<bx_include_auto:_header.html />
 <?php include 'simple_page_to_include.html';?>
<div class="sys_root_bg"></div>
<div class="sys_root">

 

Templates/newTemplate/simple_page_to_include.html

<h1>"Hi, hello world".</h1>

 

Guys, can anyone tell me why this is not working? Is this a bug? Why can't Dolphin add a simple include on subheader?

 

I'm sure this is some oversight on my part, but I can't see what it is. 

 

Thanks guys

DivineArc

 

Quote · 30 Dec 2016

Which template specifically. Keep in mind - if you make a change in the uni template - these changes will not be reflected if viewing site with evo template.

 

If this is not the case - make sure to clear all caches (I turn off all my caches, and still clear them manually after making changes).

 

Also, you are trying to run a php script in an .html page - this will not work. In order to run a php script - the page must be a .php page (at least as gar as I know).

 

you could try:

 

<bx_include_auto:_header.html />

<bx_include_auto:simple_page_to_include.html />
<div class="sys_root_bg"></div>
<div class="sys_root">

 

or, try going to the Admin section - Settings - Basic Settings - Injections - and add your code there. See if that works

caredesign.net
Quote · 30 Dec 2016

Also, don't confuse these template .html files as true html files; these are sent through the template parser that handles such things as the bx_include tags; they are not parsed directly by the browser.

Geeks, making the world a better place
Quote · 30 Dec 2016

Hey Guys,


It's been a bit, but wanted to say thanks a mill for the pointers.

And absolutely right about that parsing - just not designed for any type of linking (links, source equals, imports - none of it).  I guess that's because by design bx_include imports css styles automatically -- which works great by the way.  You simply drop the code in your template css files and Walla! out comes the mods.  Of course, that's old news when it comes to template modifications.


But here's something I thought was pretty neat, even though you can't set up linking, you can still define and call functions right in the header and subheader, and better yet you can mix and match between the admin header injection (great idea btw) and the sub_header (which is what I ended up doing).  This works quite nicely for custom code not conducive to database design blocks.  The only thing I might add (maybe this should be in requested features) is a js template folder, just like we have a css template folder would streamline the process greatly and absolutely cover all the bases.  Granted most of the code can usually be stuck in the text and php blocks, but for those times when that's just not doable, dropping it in a js folder just like we drop it in a css folder would be super cool.

So, for anyone needing to make header, sub_header mods, or just code that won't work in the database design blocks:

1) Just go to your default template folder (would suggest creating a custom default template for this [if need help just reply]) and stick the code underneath your <bx_include_auto:_header.html /> in the sub_header file.

2) You can also experiment as to where exactly in the <bx_include_auto:_header.html />  code tree -- or even the header.html file (although you'll want to most likely drop this a little ways down the code tree for main header mods) -- works best for site performance and speed.

3) (Maybe I can sneek this on the wish list without double posting) but a js folder were we could drop code just like we do with CSS would be Huge!

Happy New Year all

DivineArc

Quote · 1 Jan 2017
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.