Git Product home page Git Product logo

Comments (2)

ikkez avatar ikkez commented on August 23, 2024

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.

eliargon avatar eliargon commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.