MagicRepeat links

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

MagicRepeat links

Postby kosborn » Tue Oct 23, 2012 1:58 pm

I have a menu built
http://iconsafe.free.magicedit.com/includes/menu.html and included on the site so you can see it in place here http://iconsafe.free.magicedit.com/product.html

The links in the menu go to category.html

Which pulls up this dynamically created link
http://iconsafe.free.magicedit.com/category/2

But the page that comes up here http://iconsafe.free.magicedit.com/category/2 does not reflect changes I've made on category.html

i.e. this page http://iconsafe.free.magicedit.com/category.html looks different than this page http://iconsafe.free.magicedit.com/category/2 and I can't figure out why (and I want the latter to look like the former)

Thanks--
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm

Re: MagicRepeat links

Postby kosborn » Tue Oct 23, 2012 4:00 pm

I am starting to see the reason for the problem although don't have a solution yet. The page is referencing an include file but its doing so with a relative path, and the dynamic URL is in a dif. location (nested in folders) so the relative path is not coming up.

I tried using an absolute path for the include
<!--#include file="/includes/ICONheader.html"-->

But the above doesn't work
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm

Re: MagicRepeat links

Postby raw10 » Tue Oct 23, 2012 4:25 pm

I think your issue is that you're using me_repeat="yes" too much. That tells the system to create a nested repeat, so if you're on a repeat page it thinks it's a whole new repeat inside the page instead of relying on a global repeat.

To fix the problem, simply remove the me_repeat="yes" on all top level (global) repeats. For example, the following code in menu.html:

Code: Select all
<magicrepeat me_name="CategoryGroup" me_repeat="yes">
  <li><a href="category.html"><span><magicedit me_name="CategoryHeading" me_repeat="yes"  me_plain>Category Head</magicedit></span></a>
    <ul class="subNav">
      <magicrepeat me_name="SubCategories" me_repeat="yes" >
        <li><a href="category.html"><magicedit me_name="SubCategoryLink" me_plain>SubCategory Link</magicedit></a></li>
      </magicrepeat>
    </ul>
  </li>
</magicrepeat>


... should become ...

Code: Select all
<magicrepeat me_name="CategoryGroup">
  <li><a href="category.html"><span><magicedit me_name="CategoryHeading" me_plain>Category Head</magicedit></span></a>
    <ul class="subNav">
      <magicrepeat me_name="SubCategories" me_repeat="yes" >
        <li><a href="category.html"><magicedit me_name="SubCategoryLink" me_plain>SubCategory Link</magicedit></a></li>
      </magicrepeat>
    </ul>
  </li>
</magicrepeat>


You'll notice that the only time I'm using me_repeat="yes" is when I'm nesting a repeat inside another. Otherwise just leave it off.
raw10
 
Posts: 81
Joined: Tue Apr 12, 2011 2:46 pm

Re: MagicRepeat links

Postby kosborn » Wed Oct 24, 2012 11:12 am

Yeah! That worked!

I *still* don't get when to use magicrepeat="yes" or not. Its already a repeat, so I don't know what saying yes really means. I just try & copy old code from other sites where I did something similar to what I am doing in the new site. Thank you.
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm

Re: MagicRepeat links

Postby raw10 » Wed Oct 24, 2012 12:08 pm

Nested repeats are a brain teaser, for sure.

Just think about it this way. If you just use a plain named MagicRepeat anywhere on the site, it will have the same content. That's true even if it's living inside a dynamically created repeat page. You'll always get your category listing or services listing or news listing that lives at the top of the site.

BUT, if you should want to nest repeats inside each other, simply add the me_repeat="yes" attribute, which tells the system to create a completely new instance within whatever scope it lives.

So top level repeats should stick with the default me_repeat="no" (or just leave it off), and sub-repeats should use me_repeat="yes".
raw10
 
Posts: 81
Joined: Tue Apr 12, 2011 2:46 pm

Re: MagicRepeat links

Postby raw10 » Wed Oct 24, 2012 12:08 pm

Maybe we should change it to me_nested="true" instead.
raw10
 
Posts: 81
Joined: Tue Apr 12, 2011 2:46 pm

Re: MagicRepeat links

Postby kosborn » Wed Oct 24, 2012 2:22 pm

Maybe. If that's what it means at least I can remember that.

I have another problem. I've built out my menu and now the page isn't rendering.

here's the menu http://iconsafe.free.magicedit.com/includes/menu.html
Which is an include on the product & category page (in 2 places)

http://iconsafe.free.magicedit.com/category.html
http://iconsafe.free.magicedit.com/product.html

And these two pages, the menu is showing at the top but just about nothing else is. What's going on?
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm

Re: MagicRepeat links

Postby raw10 » Thu Oct 25, 2012 9:24 am

I think you have an extra </ul> tag in ICONHeader.html:

Code: Select all
<div class="subNavigation_bg">
  <!--<ul class="subNavigation">-->
    <!--#include file="includes/menu.html"-->
  </ul>  <!-- ----- Comment this out as well -->
</div>


Looks like you commented out the opening <ul> but not the closing </ul>.
raw10
 
Posts: 81
Joined: Tue Apr 12, 2011 2:46 pm

Re: MagicRepeat links

Postby kosborn » Fri Oct 26, 2012 10:49 am

You are right, thanks for catching that. I assumed it was some magicedit quirkiness and overlooked my own HTML changes! THank you!
kosborn
 
Posts: 77
Joined: Wed Sep 14, 2011 2:02 pm


Return to MagicEdit Discusson

Who is online

Users browsing this forum: No registered users and 1 guest

cron