Going through the docs, I found a lot of information on (built-in) shortcodes and partials. Unfortunately, I did not found information on how to use built-in shortcodes within templates.
Being more specific, I use the academic template and in one place, I want to replace the text field with a vimeo/youtube video. The content of the text field is passed by using variables e.g.:
video_id = "123456"
If I use within the template the shortcode syntax, I get an error.
sorry, I might be mixing up things/concepts - still new and learning. But isn’t a shortcode in the end a reference to a partial? So I should be able to use the partial for embedding youtube/vimeo etc.?
In a nutshell, shortcodes allow you to use template logic directly in your content. If you’re editing a template, no need to use a shortcode. Whatever code is inside the shortcode, you can likely copy/paste into your template.
but isn’t the philosophy of shortcodes and partials - write once re-use it everywhere? Basically try to avoid copy/paste operations? Why do I have to redefine something, that is already there, instead of just making a call to the built-in functionality?
Sidenote: Where are the built-in shortcodes defined?
No, partials are reusable code for templates, shortcodes are reusable code for content. If your use case allows for reusing code between the, then you will probably figure it out. But most shortcodes and partials do not share code from a practical standpoint. I have no philosophical qualms with that.
So, a shortcode can include partials (which is fairly common), but even if using shortcode templates from “regular templates” is possible, I don’t think it is practical. A shortcode will typically have a different API.
Or something; but I would expect most shortcodes to fail, because they expect some particular input, which is why I said that it’s easier to do it the other way.
Or something … That said, your shortcodes most likely expect the argument it’s getting when invo