Are there other delimiters I can use in a single page? Which one?
For example: The first area should use 3 columns, the second 2 columns.
So for the first one I could use the delimiter.
And for the 2 column area I could use the other delimiter.
You can really use any delimiter although the ---/<hr /> one is ideal because it is syntactically accurate (ie, that’s the entire purpose of the hr tag in the first place!)
You would just have to find something that works for your content.
I has to be something that either markdown doesn’t mess with, or something it does process, but you can grab on to. For example you could use --\-- and then update the twig so it uses split('--\--') as Markdown is not going to convert the --\--
Ok gonna try this, too.
As a Joomla/Gantry User I know how to get there. And even now with Gantry 5 it’s very easy to build complex pages.
But it’s fascinating to mess around with Grav…
And as far as I know gantry 5 is intended to be used in Grav too…
I tried to use another delimiter(/**) in my twig file but I get the message:
The block ‘content’ has already been defined line 6 in “modular/test.html.twig” at line 13
my twig:
the special Twig command block defines something like a “scope” for a part of your twig file. Usually it is used to make it overridable by a child template (see http://twig.sensiolabs.org/doc/tags/extends.html#how-do-blocks-work) and therefore block names have to be unique. In your code you are trying to define two times the same block name “content”.
Hi, thanks for the tip. Error message is gone.
The only problem is: The content separated from the first delimiter is displayed again in the second col-lg-12 text-left and the content from the second delimiter is displayed again in the first col-lg-text-left. ???
@flaviocopes AFAIK, creating columns via CSS is really handy, unfortunately not well supported, especially when wants to support older browsers, though…
@arank Yes, this is what you see with the above code. An updated version, which doesn’t have such a caveat you can find below.
Hi Sommerregen,
thank you. Your Code works, no doubled content anymore.
Only thing:
I want to use different column layouts for each delimiter.
For the first delimiter (—)a col-md-4, for the second delimiter (/**) a col-md-6 layout.
This is doable and there exists several approaches. The easiest and probably most convenient approach is to alternate the column layouts using the cycle function independent of your delimiter:
Thus, you can freely decide, mix and replace your delimiters “—” and “/**” in your document. This is not exactly what you want, but you can see it as a starting point for your own modifications. At last, the best way to learn Twig is to study the Twig documentation extensively and try it on your own
Hi,
thank you very much. This approach is very flexible. For each part of content in a delimiter I can/ have to define a layout. Otherwise content/layout is cycled/repeated.
But I see, I have to study more…Twig/Grav