BLOG:CMS :: Support Forum

Support Forum for BLOG:CMS

You are not logged in.

#1 06.01.2009 04:48

Riley
newbie...
From: Texas
Registered: 25.12.2008
Posts: 5
Website

New Item Button on Navigation Sidebar

I searched the forum and other sites and I am still having trouble getting the code to work.

add item to form

1. JavaScript code
First of all, you need to include the edit.js Javascript code by putting the following line somewhere in between the <head> and </head> tags. This file contains the functions that are needed to make the preview work and to hide/show the 'add item' form.

<script type="text/javascript"
        src="nucleus/javascript/edit.js"></script>

2. Indicate where the form will show up
The, you add a logical container somewhere on your page, where you want to have the 'add item' form. The "display:none;" makes sure it is hidden.

<div id="edit" style="display:none;">
...
</div>

3. Code that inserts the form and preview
Now, you can add your custom HTML into this container, and use <%additemform%> and <%preview(templatename)%> to insert the 'add item' form and the preview code respectively. An example is given below

<h2>Add Item</h2>
<%additemform%>

<h2>Preview</h2>
<%preview(mytemplate)%>

4. The 'add item'-link
And the finishing touch: a link or button to trigger the visibility of the form. Two examples are given. The first one is a simple link:

<a href="javascript:showedit();">add item</a>

====================

1.  In header extra skins is the only place where I found <head> tag.
2. and 4.  Inserted in Skin Main Index
3.  Not sure what to do with that.

I  am a total noob and I am not getting it.  Please help.  I want a link that opens up "New Item" so I can add without having to enter Admin Area, Select Add New Item.  I have the link where I want it; however, it does not work.

Thanks.

Riley

Last edited by Riley (06.01.2009 05:00)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

TOPlist