Sorry to post another thread about this but I cannot find an answer to my problem. Perhaps it is explained better here.
Is anyone aware of any way to perform a 'HTML include' inside of the content of a Shopify page, i.e. a blog post?
With my previous web site I used to use PHP includes and the process was simple to insert sections of HTML within HTML, from external files, for those pieces of content which are repeated across multiple pages of a web site which you would be able to update by editing only one file.
Let's say you wanted to include a DIV at the bottom of a blog post which includes the author's details. You would want to use a HTML include so that if those details changed in the future you could update one file and it would update across all pages.
I know you can include Liquid snippets from within the theme files but I don't think this will work for me since I want to include the HTML in the middle of an article's content and not simply at the bottom of a page where it probably would work.
Is this possible?
Yes you can add html content by using blog-template.liquid file.
If you want to add html content at middle you can add it in edit blog code section.
Thanks for the reply. As I understand it, that does not help me to insert HTML in the middle of a blog post. The template file will make reference to the 'article-content'. Adding code to the template file is only going to allow me to add content above or below the article content and not in the middle of it.
Is that correct, and if so do you know how I can include HTML in the middle of a blog post from an external file?
You can also add html at the middle of content.
Write your content inside <> this section.
Thanks for the reply.
I'm not sure we're fully understanding one another here. I'm aware that I can insert custom HTML in the middle of a blog post using the rich text editor and using the <> function, which shows the code. I know all that.
What I'm trying to do is the insert HTML from another file - an external file - in the middle of a blog post. i.e. like a server-side include.
Do you know this might be done?
You can't insert html from another file, you can use html tags only inside that editor.
So I know it can be done, I just don't expect to have to pay $9.99 per month for it.
I can't be the only person with this problem. Having the same features throughout a site's content is commonplace. To update that content you should not have to go and edit 100's of pages individually, you should edit one file and bam! job done.