Magic Repeats to Show up upon editing

Discussion about MagicEdit features, modules, applications, and HowTos.

Magic Repeats to Show up upon editing

Postby kosborn » Thu Sep 06, 2012 2:48 pm

I don't know what I am doing wrong. Again

I want any of these repeats to show up once they are edited. But it appears that I edit them and they still don't show up.

http://www.sandrastoutcpa.com/new.html
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm

Re: Magic Repeats to Show up upon editing

Postby kosborn » Mon Sep 17, 2012 3:40 pm

Any help on this?
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm

Re: Magic Repeats to Show up upon editing

Postby raw10 » Mon Sep 17, 2012 4:26 pm

I think your issue might be that you are checking for ".hasEdits" within the scope of a repeat itself. It's designed to determine if a repeat has any edits within it at all, so it only makes sense to use it in the same scope as the repeat, not inside that repeat.

Also, it looks to me like you want to hide or show individual MagicEdit elements if they have been edited, which is a different check. Here's a guess at something that might work for you.

Code: Select all
<!-- Show repeat if an admin is logged in or anything in the repeat is edited. -->
<magicrepeat
    me_name="newsrepeat"
    cl_visible="=CLManager.activeAccount:isAdmin||$newsrepeat.hasEdits">

  <!-- Only show the paragraph if $heading has been edited (exists in the database) -->
  <p cl_visible="=CLManager.activeAccount:isAdmin||$heading">
    <b><magicedit me_name="heading" me_plain>List Item Head</magicedit></b><br />
    <magicedit me_name="text">List Item All Text</magicedit>
  </p>

  <br /><br />

</magicrepeat>


You could also apply the cl_visible to another element in the page, say, a wrapper DIV or parent UL. Also, the interior paragraph will only show if the "heading" element has been edited, but not if the "text" element is edited. This lets you do something where you trigger off of a particular element and only show a bunch of other stuff if that trigger element has been edited.

Hope that helps!
raw10
 
Posts: 81
Joined: Tue Apr 12, 2011 2:46 pm


Return to MagicEdit Discusson

Who is online

Users browsing this forum: No registered users and 1 guest

cron