Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Thanks to the amazing support here, I've been able to get WAMP and Couch working properly.

I am currently embedding snippets. When I access http://localhost/aurelius.com/blog.php, I receive the following message on an otherwise blank IE11 tab: ERROR! Tag "show" has no matching closing tag (line: 316 char: 6349). "line: 316" obviously refers to some other line of code than in blog.php as there are not that many lines in the file. The only "show" tags I have in the code for blog.php are the two associated with blog_image and blog_content. I get the idea, from the attached bit of code, that VS Code may not be happy with the embed command...or something? Can anyone assist me in interpreting the error message and in finding my mistake?

Attachments

Hi,

I am glad you now have a working setup to play around with Couch.

Coming to the problem you mentioned -
you are right about the line numbers mismatch - when we use <cms:embed .. />, Couch actually *expands* the embedded file in-place so, virtually, it is the same as if the contents of the embedded file were actually copy/pasted at that location. As you can see, from the parser's perspective this increases the number of lines in the containing file. This causes the mismatch between what you see and what gets reported.

Anyway, that also explains another important point -
if there happens to be a syntax error in one of the embedded snippets (or even in one embedded in another embedded snippet and so on), the parser will only report that there is a syntax error without a clue as to in which embedded snippet that error actually is.

To get around this, the suggestion is to work incrementally i.e. begin with a working setup and them make small, manageable changes to only one file/snippet. Refresh browser; you'll hopefully see the results of your changes. In case, you get an error, you'll know exactly where to look (you last changes). Thus, incidentally, is also a preferred practice on all coding languages.

So, now finally coming to the error you are getting -
Tag "show" has no matching closing tag

Tags in Couch are of two varieties
1. Self closing - where the end '/' slash is in the opening tag itself e.g. <cms:show k_page_title />
2. Pairs - where the end '/' slash is in a second closing tag e.g. <cms:repeat '3'> ... </cms:repeat>

Your error suggests that you used the show tag somewhere without the end '/' slash e.g. as follows -
<cms:show k_page_title >

That makes the parser think it is a tag pair and then look for the ending </cms:show>, which of course is absent. Ergo the complaint.

VSCode has phenomenal searching capability - please search for "<cms:show" and you'll find the problem statement.
If you still happen to need any help, please zip up the concerned files (main + the snippets) and we'll take a look.
I have looked for the offending "show" tag and am unable to find it. The only instances of "<cms:show" that I find in my files are the two regarding post_content and post_image.

Attached is a .zip with my blog.php and blog_list.html files. I have the sinking suspicion that the mistake will be fairly easy to find. As I frequently tell my wife: I'm not saying it isn't there; but I can't find it.

Your assistance is sincerely and greatly appreciated. Your help makes it much more likely that I get this project launched--which means I'm much closer to convincing my wife that I am not lost in a colossal time sink.

Attachments

No problem :)

I had a look and the error is on line 78 of blog_list_.html -
Code: Select all
<cms:show blog_content>

As you can see, there is no closing slash.
Make the statement <cms:show blog_content /> and things will begin working.

Next, as I suggested before, make small changes to a single file and test before moving ahead.
An error at any point and you will know exactly where to look for it.

Hope this helps.
So, it turns out that you are not helping me use Couch so much as you are teaching me to find my own mistakes. I apparently had two copies of blog_list.html--one in my aurelius.com folder, and one in the snippets folder. I am not entirely sure how I managed to place the offending "show" command in one and not the other, as I should not have been modifying that file after the initial renaming. I went over the blog_list file showing in VS Code several times looking for a mistake that was somewhere else entirely.

I have never encountered an organization so willing to assist others in using their product. I have never seen technical documentation written is such plain language. I have never met a lead developer so willing to share time with others.

I will be buying a license. As I begin to mingle in the WebDev community, I will certainly be recommending CouchCMS.
5 posts Page 1 of 1