Comments (2)
It's documented right that.
You can also have dynamic content in the form of:
<include href="{{ @content }}" /> // OR <include href="{{ 'templates/layout/'.@content }}" /> // WRONG <include href="templates/layout/{{ @content }}" />https://fatfreeframework.com/3.8/views-and-templates#TemplatesWithinTemplates
The real explanation behind is, that it's way more complex for template directives to handle such a case, and it must be implemented in every directive itself, hence there's no one fits all solution. The main template directives that come with F3 only supports static string or token usage for its attributes and no mixed usage.. at least it's documented right that.. hence you have to use the string concatenation within the token to make it work.
from fatfree.
Thanks Christian.
I have tried to use a library of shared template which I connected to the Document Root via a symbolic link.
When a template is included, F3 assumes the base folder to be UI (as defined in config.ini) .
For example: in config.ini Ihave
UI=./uiW3/
W3tpl=../awLib/W3/
Note: the W3tpl is a shared libray. So when using a shared template from the library, I have to define the path from the base UI so I step one folder back.
Thus : in my layout.tpl file I can have
<F3:include href="./pg/pg_footer.tpl"/>
which assumes a path starting with UI (https://example.com/uiW3/pg/pg_footer.tpl)
or
<F3:include href="'{{@W3tpl.'pg/pg_footer.tpl'}}"/>
which assumes a path starting with ../awLib/W3 (https://example.com/awLib/W3/pg/pg_footer.tpl)
Thanks again for a wonderfull framework.
from fatfree.
Related Issues (20)
- Form data are not being parsed on patch HOT 1
- avoid useless database connections HOT 2
- Sql Mapper: Misleading error message when setting value for non existent field in the mapped table HOT 3
- How to use SQL Mapper save method to insert/update a geometry field type?
- Extend template error
- breakin in the middle of a <repeat> loop in an F3 template file. HOT 2
- Named route incorrectly includes the extra @params in the route HOT 2
- Google Static Maps - is this still a feature? HOT 1
- XDebug? HOT 2
- Custom date format not respecting parameters (PHP8.1) HOT 2
- Remove HTML comments from template (minifying) HOT 6
- Dockerised fatfree redirects broken HOT 3
- @variable ?? '' HOT 1
- SMTP class question HOT 4
- Error in SMTP class // scripts aborts, no error handling possible HOT 1
- bug foundn base.php HOT 1
- trigger a strange PDO syntax error HOT 7
- BASE->recursive HOT 1
- Couchdb Database HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fatfree.