Loading...
 
Features / Usability

Features / Usability


Creating Tags

posts: 101

Hi folks. I'm wondering how I might go about adding new tags to Tiki, such as the ^ or ! tags? So far I've been creating Quicktags using straight HTML, but it's leading to horribly cluttered looking pages when I go to edit.

For example, I'd like to replace the following:

<xmp> <center> <DIV STYLE="position:relative; Text-align: left; padding: 5px; background-color: white; width:90%; border:1px #000000 solid;"> Some text </DIV> </center> </xmp>


with something as simple as: ~box~ Some text ~/box~

Can anyone explain how I can do this?

posts: 4656 Japan

I'm not really sure why you see clutter when editing your pages. It seems to me if you edit using Quicktags, you just see the Quicktags, not the HTML they produce. I mean that's the way the default ones work. Also, I'm wondering why the xmp tag. But anyway, a simple way to get rid of the inline style properties is to use the DIV plugin with a class parameter like

Copy to clipboard
{DIV(class=>newbox)}Some text{DIV}


and then put all the styling in the theme's CSS file like

Copy to clipboard
div.newbox { position: relative; text-align: left; padding: 5px; background-color: white; width: 90%; border: 1px #000000 solid; }


The DIV plugin code isn't as compact as a Quicktag, but it's much easier to implement and is more flexible.

-- Gary - themes.tw.o


posts: 101
Thanks chibaguy, I appreciate the tip. But, is there no way to create a complete substitution for the HTML by a single character or a short tag sequence? Rather than having any html code to create my "newbox", could I not just have a sequence like I gave above (eg. ~box~ Text ~/box~)???

posts: 3665 United States

I think what you're asking is to expand the Tiki wiki syntax. This might be tough, but you can easily create custom wiki plugins that will do whatever you need.

For example here is a quick plugin I created that will create your custom box. Usage is:

Copy to clipboard
{MYBOX()}text for the box goes here{MYBOX}


HTH,

-Rick



> Hi folks. I'm wondering how I might go about adding new tags to Tiki, such as the ^ or ! tags? So far I've been creating Quicktags using straight HTML, but it's leading to horribly cluttered looking pages when I go to edit.
>
> For example, I'd like to replace the following:
>
> > > > > Some text > > > >
>
> with something as simple as: ~box~ Some text ~/box~
>
> Can anyone explain how I can do this?


posts: 101

Hi again. I finally had a chance to start working on this issue and I'm still having troubles with it. Following the instructions from the Plugin Doc's Page as well as from Rick's example above, I'm unable to get the plugin to work. When I place the plugin code in my Tiki page, the contained text simply does not appear.

Here's what I've done:

1 - Created my plugin code (as previous example). I've attached the file below...

2 - Named my file wikiplugin_subbox.php

3 - Uploaded the file to lib\wiki-plugins

4 - Included the following in my Tiki page:

{SUBBOX()}just testing {/SUBBOX}


posts: 3665 United States

Hmm... your plugin worked fine for me. One thing, there's no / in the closing tag. Try:

Copy to clipboard
{SUBBOX()}just testing {SUBBOX}



> Hi again. I finally had a chance to start working on this issue and I'm still having troubles with it. Following the instructions from the Plugin Doc's Page as well as from Rick's example above, I'm unable to get the plugin to work. When I place the plugin code in my Tiki page, the contained text simply does not appear.
>
> Here's what I've done:
>
> 1 - Created my plugin code (as previous example). I've attached the file below...
>
> 2 - Named my file wikiplugin_subbox.php
>
> 3 - Uploaded the file to lib\wiki-plugins
>
> 4 - Included the following in my Tiki page:
>
> {SUBBOX()}just testing {/SUBBOX}
>
>
>


posts: 101
Thanks Rick, that did the trick.