Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi,

I was hired *ahem* by my dad to turn his static site into a CMS powered site so that he wouldn't have to bother with using the website creator program he made the site with initially, which is incredibly amateuristic and creates horrible code. I have installed Couch rather easily as planned and I have spent the last few hours fixing the horrible code created by the website creator to prepare it to be modified by Couch without too much problems, as well as some other improvements.

I have a problem, however. Couch is designed to modify existing websites using largely rich text. The website I am supposed to transform into a CMS powered site is not a site where that applies to, however, it is more of a homepage or navigation portal for our local town. So it makes use of series of links formatted in ways that Couch cannot easily modify as far as I know, and my dad does not want me to make large structural changes to the site. So I need to use templates that can be put into a page, but AFAIK that is not possible.

Clarify: If you have ever been an editor on a wiki, you might know what I mean. Mediawiki uses templates that are defined on their own pages, and can be put into articles very easily by simply referencing the page name of the template. Sometimes using arguments to make the content of the template more dynamic. That is the kind of template I need.

Other clarify: It could be essentially the same as an iframe.

Is there any way I could do this or if not, is there any chance of it being added?
Hello and welcome, @latias1290 :)

I'd be glad to try and help but have no experience with Mediawiki, I'm afraid.
Perhaps others from the community can suggest some solution for using Couch the way you described.

If possible, it'd great if you could post some screenshots explaining in greater detail the use-case.

Thanks.
KK wrote: Hello and welcome, @latias1290 :)

I'd be glad to try and help but have no experience with Mediawiki, I'm afraid.
Perhaps others from the community can suggest some solution for using Couch the way you described.

If possible, it'd great if you could post some screenshots explaining in greater detail the use-case.

Thanks.

hi, sorry for taking a while to respond. Busy weekend.

I'll try to explain the concept of templates as clear as possible:

On Wikipedia, you may see things like this:

Image

In the source of the page(not HTML, but Wikitext), they are written like this:
Code: Select all
{{Plot|date=January 2012}}

More in detail:
Code: Select all
{{ defines the start of a template reference. It is very similar to < in HTML.
}} defines the end of this reference.
"Plot" tells the engine where the source is located. This is, by default, in the Template namespace of the wiki, so you don't have to type Template:Plot, just Plot.
The pipe (|) tells the compiler that the next part of the tag is an argument. Every new pipe seperates each argument. You can define how arguments are used in the source of the template. This can be mirrored in Couch by something like <cms:argument name="this" default="that" /> in the source of the snippet, and it would just put what you used as the argument at the place of the tag.


This code essentially instructs the Mediawiki engine to show a piece of code, pointing to (not substituting - that replaces the text with the source of the template, which has several downsides. Normally you refer to a template, making it updated whenever the source of the template gets updated.) a piece of code located on its own page. In this case, the source is at this page, in a seperate namespace (folder) that is designated to contain only templates and not actual content.

What I'm suggesting here is to create basically the same thing. A folder that contains .html files, or maybe .php or .asp files, which are the templates.

In the rich text editor on the admin panel, you could click a button to add a template and it pops up a list of defined templates. (Templates would be defined in a very similar manner to how pages are currently added to the admin panel.) And you could use the arguments I mentioned to define exactly what parts of the template can be edited in the editor and what cannot.

Because some things are not always seen by the end user, such as the style attribute of a <div>, you should also be able to edit it easily in the source code. It could be like this:
Code: Select all
<cms:usetemplate name="atemplate.html" argument1="Some text" argument2="More text" />

The argument1 and argument2 parts would be defined right <cms:argument name="here" />.

The purpose of this is that if you have something in your site that you want to repeat multiple times over your pages, but need to be able to edit parts of what it shows, you could make it into a template.

Now, my use-case:
Code: Select all
<table width="186">
   <tbody>
      <tr bgcolor="#000080" cellborder="1">
         <td align="center" background="images/backcel.gif" height="18"><b>Header</b></td>
      </tr>
      <tr bgcolor="#66CCFF">
         <td align="left" valign="top"><a href="someurl.org">Linki</a><br />
         <a href="example.com">Linkie</a></td>
      </tr>
   </tbody>
</table>

I need to repeat this pattern for each new link block (or link section) and fill it with links for the portal I'm supposed to improve. It is cumbersome to do this with Couch as it stands now, and teaching my dad how to do it doesn't really help.

When you press enter in the rich editor, it starts a new paragraph. I don't want that, I want it to put a line break. So I need to do it in the source code, which my dad won't seem to learn really easily and is a lot more annoying to do in general.

That's the sole reason I am needing this right now because otherwise it would be far easier to do it - it's just that I think that many others would profit from this functionality existing.
You can currently do something similar:
Code: Select all
<cms:set argument_one='cheesypoof'/>
<cms:set argument_two='awesome'/>

<cms:embed 'my_template.html'/>
my_template.html:
Code: Select all
<p><cms:show argument_one/> is <cms:show argument_two/>!</p>

Furthermore, do you not find repeatable regions matching your use case?
Embed snippets worked for my case. I guess I just totally overlooked it. Thanks!
5 posts Page 1 of 1
cron