Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hello dear Couchies!

When I work, I do write couch tags by hand, and sometimes misspell them without noticing - and than spend a lot of time looking for the problem because I again overlook the misspelling (like I write k_page_titel instead of k_page_title , or hit n instead of m in cms: etc :oops: :roll: )

Is there there any kind of Couch Tag or PHP file available, to detect this kind of errors easily?

I mean, I do get error messages when I enter the page. Like this one:

ERROR! ATTRIB_NAME: Invalid char "/" (line: 0 char: 41)
but this is not really helpful, as this doe snot relate to the lines in the editor

That would be really great!

Best regards,
Tanja
Hi Tanja :)

What you are looking for is an IDE (or at least, an addon to an established IDE) with syntax checking and hints.
Unfortunately, there is none available at the moment.

I can only extend a little advice that I myself find useful while coding -
when you add Couch tags, make small, incremental additions. Try not to add more than one or two tags at a time.
Save and execute the template after every change. This way any bug or syntax error could immediately be traced to the line last added.

Hope it helps.
Hi KK :) ,

thanks for your swift reply for the advice!!!! As always - everything you say is helpful!
It sounds simple, but I did not think of it until now...

I'll do that.

best regards,
Tanja
You could use http://www.sublimetext.com/ and use the autocompletion

like:
Create a file and save it with the .sublime-completions extension in your user packages folder. Something like mycouch.sublime-completions.
Start with the following code in this file
Code: Select all
{
  "scope": "text.html - source - meta.tag, string.name.classes.punctuation.definition.tag.begin",

   "completions":
   [
      { "trigger": "cms:pages\t<cms:pages>", "contents": "<cms:pages>$0</cms:pages>" },
      { "trigger": "cms:folders\tCouchCMS/Tag", "contents": "<cms:folders masterpage='$1' $2>\n $3\n</cms:folders>" },
      "pizza",
      "beer"
   ]
}


Now when you edit a html file and type cms you get a list of cms:folders and cms:pages . When you choose let's say folders you get as result:
Code: Select all
<cms:folders masterpage='' >

</cms:folders>

using the tab you can fill the missing parts.

The syntax is quite easy (JSON).... "pizza" in this example will give pizza on typing pi and so on.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Hi Tomarnst,
thanks for chiming in!

I work with Brackets, Sublimetext I do not really need it, since I only write HTML and SASS, and it is expensive. Brackets too feature self closing tags, but if I misspell that does not help, it does not auto correct ...


Best regards!
Tanja
I also use brackets and it would be awesome to have autocompletion and code hints for <cms /> tags. I'll be happy to chip in a bounty for it.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
FYI

Sublime text offers a demo without expiring data.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
7 posts Page 1 of 1