R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Reusable Snippets
Last Post 01 Jan 1900 05:00 AM by . 1 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
myearwoodUser is Offline
New Member
New Member
Posts:60

--
04 Feb 2007 04:40 PM  
Hi all

This is an idea I've use in another environment. There is a need for a way to reuse small segments of code (snippets). For example, using the list format and the alternating list format - since the two are virtually identical, I could take this:

List Format
<tr class=DataGrid_Item>
<td>
<a onclick="return window.confirm('Delete this store?');"
{ACTION,[StoreID],DeleteStore,,Message}>
<img border=0 src="http://[ALIAS,System]/images/delete.gif"></a>
</td>
<td><a {ACTION,[StoreID],CurrentStoreID,Store Detail,Session}>[StoreID]</a>
</td>
<td>[StoreName]</td>
</tr>

Alternating List Format
<tr class=DataGrid_AlternatingItem>
<td>
<a
onclick="return window.confirm('Delete this store?');"
{ACTION,[StoreID],DeleteStore,,Message}>
<img border=0 src="http://[ALIAS,System]/images/delete.gif">
</a>
</td>
<td><a {ACTION,[StoreID],CurrentStoreID,Store Detail,Session}>
[StoreID]
</a>
</td>
<td>[StoreName]</td>
</tr>

and do do it like this:

List Format
<tr class=DataGrid_Item>[Snippet:StoreList]</tr>

Alternating List Format
<tr class=DataGrid_AlternatingItem>[Snippet:StoreList]</tr>

We'd only a place to define and maintain "Snippets". Possibly a new table and a new option on the ListX module?

Snippets Table
SnippetName, SnippetCode

"StoreList", <td>
<a
onclick="return window.confirm('Delete this store?');"
{ACTION,[StoreID],DeleteStore,,Message}>
<img border=0 src="http://[ALIAS,System]/images/delete.gif">
</a>
</td>
<td><a {ACTION,[StoreID],CurrentStoreID,Store Detail,Session}>
[StoreID]
</a>
</td>
<td>[StoreName]</td>

Then we could maintain such snippets in one place.

In the other environment, I provided support for parameters. That could be an enhancement to this later.

Mike
TalalUser is Offline
New Member
New Member
Posts:90

--
07 Aug 2007 08:42 PM  
hmm check out this http://symphonyoffire.com/ListX/tabid/368/Default.aspx

It could help you in generating the tab without too much redundency
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share