Hi there,
some very serious questions for me, because I try to build a reusable structure for my work. For Info: I’m working with the file based template option and I’m using the YAML-CSS-Framework also as files (just in the root folder). I want to achieve the following.
* I want just ONE “main”-template so I can change layout structure, menu elements, JS and other global things in this central file
* A channel called “includes” with the fields title, file, pagetitle, description, keywords, etc.
* The main-template holds the whole layout (header, nav, footer, etc) and loads dynamic content based on the URL-segments
Up to here everything works fine. For example:
I’m having:
{exp:channel:entries channel="includes" url_title="{segment_1}"}
<head>
<meta name="description" lang="de" content="{description}">
<meta name="keywords" lang="de" content="{keywords}">
<title>{site_name} | {pagetitle}</title>
<link href="css/layout.css" rel="stylesheet" type="text/css"/>
[removed][removed]
</head>
<body>
<header>
.
.
</header>
.
<main>
{embed="includes/{file}"}
</main>
.
<footer>
.
</footer>
</body>
{/exp:channel:entries}The content loads correctly based on {segment_1} which ouputs the right {file} to load in the embed call but the links to the CSS and JS files are broken.
But if I use for example
<link href=”{site_url}css/layout.css” rel=“stylesheet” type=“text/css”/>
instead the linked files are working correctly.
So my questions are:
* In general: Do you recognize wich “one-file”-structure with dynamically loaded embeds I try too achieve? Is it possible an effective how I do it? Are there much more better ways? (The extensions and solutions I found did not really match what i want (e.g. MX Jumper, or the homegrown plugin solution from johndwells)
* I think the css is not loaded when missing the {site_url} because of the structure that ee normally expects when e.g. {segment_1} is not empty, right? Is there a solution to just force ee to always only load the main index template regardless of the segments - so all the paths in the templates always expects the root folder as starting point? IF yes, are there many ee-properties that will not be usable with my solution all over the whole site then?
Thank you very much for any help!