SnippetMaster Support Forums
Return to main website
 
March 20, 2011, 12:32:58 PM
* Show unread posts since last visit.
* Show new replies to your posts.
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 20, 2011, 12:32:58 PM

Login with username, password and session length
Search:  
Advanced search
* Home Help Search Login Register
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Need help with using multiple snippets for multiple users on the same page « previous next »
Pages: [1] Print
Author Topic: Need help with using multiple snippets for multiple users on the same page  (Read 836 times)
eventide

Posts: 19


WWW
[-] Need help with using multiple snippets for multiple users on the same page
« on: January 18, 2010, 01:30:43 PM »

I'm working on a page that has a table, but I only want part of the table to be editable by a particular Regular user:

Here is sample code showing the table and surrounding content I'm trying to add snippet tags to. How would I manage the snippet tags for what I'm trying to do?

Code:
<p>There is content before the table that I want to be editable by all, including the Regular user, user1.</p>
<table>
    <tr>
        <td>
            This row should be editable by all, including user1.
        </td>
        <td>
            Some content that is editable by all.
        </td>
    </tr>
    <tr>
        <td>
            I want this row to be editable by all except user1.
        </td>
        <td>
            Not editable by user1.
        </td>
    </tr>
    <tr>
        <td>
            I want to allow user1 to be able to edit this row, though.
        </td>
        <td>
            Editable by user1.
        </td>
    </tr>
</table>
<p>There is also content after the table that I want to be editable by all, including user1.</p>

[edit] I tried some "snippet gymnastics" by inserting begin and end snippets first around the content I want to exclude user1 from, and then around the rest of the page in sections to allow everybody to edit those areas. Giving each of them a unique name generated a box in the WYSIWYG editor for each snippet, of course. And using the same name for all of the snippets just showed editable content in the editor up until the first EndSnippet tag. In none of the above cases did the table structure itself show in the editor as table. The contents of the table were shown as individual paragraphs. [/edit]

I'm now convinced that what I'm trying to do is not possible (someone please show me that I'm wrong!). I'm also convinced that this can be remedied by implementing the suggestion I have here, which suggests adding the ability to nest snippets, which would allow this "inner-snippet" permissions situation to work.

Thanks for anyone's help!
« Last Edit: January 18, 2010, 01:56:46 PM by eventide » Report to moderator   Logged

f u cn rd ths u cn gt a gd jb n prgrmmng
admin
Forum Administrator
*
Posts: 2929

SnippetMaster Author


WWW
[-] Re: Need help with using multiple snippets for multiple users on the same page
« Reply #1 on: January 19, 2010, 06:30:42 AM »

Hello,

The only way to do what you are asking is by creating multiple snippets.  So for each td content you wanted to be editable, you'd need to create a Snippet.

What I'm thinking to do is maybe add a "noneditable" tag that can be placed inside a Snippet Tag.

So you would then have a snippet tag around your table, and then a noneditable tag around the content inside the table that you don't want certain users to be able to edit.

I hope that makes sense?

Report to moderator   Logged
eventide

Posts: 19


WWW
[-] Re: Need help with using multiple snippets for multiple users on the same page
« Reply #2 on: January 19, 2010, 06:47:07 AM »

Hi!

If I understand your suggestion about creating multiple snippets, I already tried that, as described in the "[edit]" section I added. Snippets can't be nested, so if I create a snippet for each <td> tag, then the table itself can't be editable in the editor. At least, when I was trying the different scenarios mentioned in my post, I couldn't edit the table unless there was one snippet surrounding the table (with no snippets inside that, of course).

Maybe I'm not understanding what you're suggesting...

And regarding your mention of "noneditable tags": is that something that can be done now, or a feature that doesn't yet exist?
Report to moderator   Logged

f u cn rd ths u cn gt a gd jb n prgrmmng
admin
Forum Administrator
*
Posts: 2929

SnippetMaster Author


WWW
[-] Re: Need help with using multiple snippets for multiple users on the same page
« Reply #3 on: January 19, 2010, 07:15:49 AM »

Hello,

Right, using several non-nested snippet tags was what I meant.  It's not currently possible to nest tags.

The noneditable tag is not something that currently exists, but will be something I'll eventually add. 
Report to moderator   Logged
eventide

Posts: 19


WWW
[-] Re: Need help with using multiple snippets for multiple users on the same page
« Reply #4 on: January 19, 2010, 07:20:03 AM »

Okay, thanks.

To be clear, though: if I have individual snippets in the table's <td> tags, then ultimately the table structure itself (i.e. adding rows/columns) will not be editable in the WYSIWYG editor, correct?
« Last Edit: January 19, 2010, 07:25:16 AM by eventide » Report to moderator   Logged

f u cn rd ths u cn gt a gd jb n prgrmmng
admin
Forum Administrator
*
Posts: 2929

SnippetMaster Author


WWW
[-] Re: Need help with using multiple snippets for multiple users on the same page
« Reply #5 on: January 19, 2010, 07:43:47 AM »

Correct.  The only way to make the table structure itself editable would be to wrap it with Snippet Tags.  (But then the inside Snippet Tags will not work correctly since tags can't be bested.)
Report to moderator   Logged
Pages: [1] Print 
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Need help with using multiple snippets for multiple users on the same page « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!