Easier? Now I have to learn Twig?

I thought this was supposed to make web development easier. I am on part 3 Theme basics and I still have no idea how to incorporate CSS classes to page elements. AND now I have to learn Markdown AND Twig php in order to create a custom site?

How does this make things easy? I am very confused. I am very comfortable writing HTML and CSS. I just don’t get how this is easy. Seems great if the only formatting I wanted was bold and itallics…

What’s with the rant? Markdown is WAY easier and faster than writing things in HTML. It’s not hard either. Basically it’s the same as writing a reddit comment.

I have an ExpressionEngine and WordPress background and the Grav way of doing things is better 9 times out of 10 (1 time out of 10 it’s only as good as the others ;)).

And by the way, if you want to, you can write HTML into your markdown files. Just enable Markdown Extra and you can do it like this:


Your markdown content **goes right here**

Grav uses Twig so you don’t have to mix PHP in your HTML. This is for clarity and security. Much easier for a designer to work with Twig than PHP.

Grav also uses Markdown for content by default, because it’s simpler and quicker and makes for more consistent and safe HTML output. I think we’ve all been in the situation where a site is ruined because a client got a bit too excited about the toolbar buttons in his/her WYSIWYG editor? :slight_smile:

You can of course mix HTML and Markdown, or even disable Markdown completely, and use pure HTML if you prefer.

The rant was frustration. The documentation leaves out a lot. How do you associate the css to the markdown? How do I learn Twig to write custom templates?

What does markdown=“1” mean?

We don’t go into details for Markdown or Twig because they have their own documentation:

Markdown -> https://daringfireball.net/projects/markdown/basics / http://markdown-guide.readthedocs.org/en/latest/basics.html / https://blog.ghost.org/markdown/

Twig -> http://twig.sensiolabs.org/documentation

The short answer is you have to use HTML to add classes. Although you can use Markdown Extra -> https://michelf.ca/projects/php-markdown/extra/ for some extended capabilities.

Grav also has custom support for adding classes and id’s to images (and links in the next RC release)

And yes these may be new to you, but Twig is the defacto temlating library for PHP that is used by many other projects including Symfony, Drupal8, Bolt, Craft CMS, etc.

Markdown is use by just about everyone these days…

Jay D, you should be thankful for awesome free software, written by volunteers in their unpaid free time, so you can earn money with this software. What’s your part, except from complaining ? Have you written something for free today ? Or in your whole life ?

Beside that, Twig can be learned in around 15 minutes.

We also used Twig for Wordpress with Timber before we switched to Grav and Timber almost made WP bearable. Basically everyone and everything uses Twig because it’s just that good. Same with Markdown. A few weeks back I had to create easily editable tables on an ExpressionEngine entry and I’ve never been so close to pulling my hair out in front of a client. With Markdown that thing would have taken two minutes, tops. Do yourself a favor and learn both, they’re huge timesavers.

For what it’s worth, I’m super grateful to the Grav team for making my life easier and plan to support them any way I can.

@panique- in two words “screw you”

I am very thankful for the software. That is why I am here trying to learn it. I learned WordPress using Gantry and I am very thankful for the guys @ RocketTheme for all their hard work. It is just very new to me and frustrating. Thank you all for taking the time to point me in the right direction and giving me information to make this process easier.

Jay D - I’m trying to help you, but please watch your tone of voice.

An open source project requires the community to treat each other with respect. Your initial comment and subsequent replies have not done you any favors.

People will of course come down hard on you if you come in to a new community with all guns blazing. This all means the community will be less inclined to help you.

Anyway, warning issued. If you continue to be rude, you will be banned from this forum. I just don’t have time to deal with petty crap.


Reviewing Twig Primer in Grav docs, it still seems as though I will need an understanding of PHP functions to create a template file.

Not really, you need a basic understanding of ‘programming’ to understand Twig. Really just if statements, for loops, variables, etc. This is standard stuff and Twig keeps it very simple.

You will need an understanding of PHP if you wish to create custom Twig filters and other plugins however.

Thanks, I will continue to experiment and play. Going through the docs on the Twig site

Kudos to all on keeping things level-headed. I get the frustration as I am new to Twig as well. I like being part of communities like this one!