Linking between Maginot Slices help

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Linking between Maginot Slices help

Postby Andross » Sat Nov 26, 2005 10:35 pm

I have a Maginot Slice that is sliced by two fields - Category for Slice 1 and Subject for Slice 2. Currently I can only link between pages under the same profile, but not sharing the same value for Slice 1 (and JUST slice 1).

I want to link between slices with the same category though (the same value for Slice 1). Basically, this is just a twist on the Prev/Next links for a sliced profile (the examples given in the documentation). I'm no Perl scripter, and I'm pretty certain it involves such. Anyone have a code that would work?
User avatar
Andross
 
Posts: 138
Joined: Wed Jun 30, 2004 7:22 pm

Re: Linking between Maginot Slices help

Postby Parahead » Sun Nov 27, 2005 11:04 am

Andross wrote:I want to link between slices with the same category though (the same value for Slice 1). Basically, this is just a twist on the Prev/Next links for a sliced profile (the examples given in the documentation). I'm no Perl scripter, and I'm pretty certain it involves such. Anyone have a code that would work?
I am not entirly sure I understand what you want to achive here, but have you taken a look at the Maginot Sliced Multi Index Profile? With that you can create an indexpage of the first slice and then subpages based on the second slice. Like I said, I don't exactly know if this is what you want to do though... Could you give a more specific (visual?) example of what you want to do if it isn't?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Andross » Sun Nov 27, 2005 6:51 pm

The Maginot Sliced Multi Index was being, eh, a bit too troublesome for its own good =]

Here's a code example - this is very similar to what I want:
Code: Select all
<PerlCode>
$PrevLink = $PrevFileURL ? qq~<a href="$PrevFileURL">&laquo; <Field: PrevSliceValue2></a>~:'';
$NextLink = $NextFileURL ? qq~<a href="$NextFileURL"><Field: NextSliceValue2> &raquo;</a>~:'';
</PerlCode>


Here is the result:
http://zappoartblog.com/portfolio/galle ... nwheel.php

Scroll to the bottom and you'll see the link implemented. What I want is for the link to go to the next file IF the first slice value is the same. For that file, the slice value (which is category) equals 'misc'.

So let's say I have misc-turnwheel.php, then nature-ancestral.php, then misc-shell.php under the slice profile photos. With the code I currently have, the 'Next' link would go to Ancestral. What I want is for it to only go to Shell, as that has an equal value for SliceValue 1.

I hope that made things clearer =/
User avatar
Andross
 
Posts: 138
Joined: Wed Jun 30, 2004 7:22 pm

Postby Parahead » Mon Nov 28, 2005 7:46 pm

Andross wrote:The Maginot Sliced Multi Index was being, eh, a bit too troublesome for its own good =]
No, not to troublesome, it does what it is intended to, but not just what you want. It was mearly a suggestion since it was unclear what you wanted to achive.

Andross wrote:So let's say I have misc-turnwheel.php, then nature-ancestral.php, then misc-shell.php under the slice profile photos. With the code I currently have, the 'Next' link would go to Ancestral. What I want is for it to only go to Shell, as that has an equal value for SliceValue 1.
OK, I would say that the first thing you need to do is sort your profile so the links to the newsitems are presented in the correct order. Do you have the SortOrders addon enabled? If so, set it to sort by two fields and then sort first by category and then the second slice field. This will make the pages be correct when hitting prev/next.

However, the pages will still "wrap" around the first slice boundry, which may or may not be what you want. If you want it to be like that, fine... :-)

If it is not what you want, eg. not having a next-link when you present the last page sharing the same slice1 value, you could take a look at the SlicePage or MultiSliceValues2 arrays which are mentioned in the documentation. I don't know exactly how much Perl you know, so I will not dig into this to deep...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Andross » Tue Nov 29, 2005 3:28 pm

Hm, well, it gets in the right order, yes, but as you already figured out, I do not want that next-link on the last page sharing the same slice1 value. So, I could mess with multiindex stuff, but I might just have to live with it anywho =P

I know absolutely no Perl btw, just to let you know =P
User avatar
Andross
 
Posts: 138
Joined: Wed Jun 30, 2004 7:22 pm

Postby Parahead » Tue Nov 29, 2005 6:39 pm

Andross wrote:Hm, well, it gets in the right order, yes, but as you already figured out, I do not want that next-link on the last page sharing the same slice1 value. So, I could mess with multiindex stuff, but I might just have to live with it anywho =P
No need to mess with the Multi Index stuff, I thought we had already come to the conclusion that wasn't what you wanted? But you could take a look at the "Previous/Next-links example 2" under the Sliced Profile section in the documentation? I guess you can figure out a layout you want with that combined with your own example above? Even if you don't know any Perl?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Andross » Sat Dec 03, 2005 4:19 pm

Parahead wrote:
Andross wrote:Hm, well, it gets in the right order, yes, but as you already figured out, I do not want that next-link on the last page sharing the same slice1 value. So, I could mess with multiindex stuff, but I might just have to live with it anywho =P
No need to mess with the Multi Index stuff, I thought we had already come to the conclusion that wasn't what you wanted? But you could take a look at the "Previous/Next-links example 2" under the Sliced Profile section in the documentation? I guess you can figure out a layout you want with that combined with your own example above? Even if you don't know any Perl?

That's what I already tried. I think the problem with that code is that it only looks for slices where both SliceValue1 and 2 are equal. I just want it to look for when only SliceValue1 is equal.
User avatar
Andross
 
Posts: 138
Joined: Wed Jun 30, 2004 7:22 pm

Postby Parahead » Sun Dec 04, 2005 5:34 pm

Andross wrote:That's what I already tried. I think the problem with that code is that it only looks for slices where both SliceValue1 and 2 are equal. I just want it to look for when only SliceValue1 is equal.
The code you have provided above is not the second example in the documentation, so it isn't easy for me to know you have tried it... If you do indeed have tried the example 2 code and it didn't work, could you please try and print out the values for Next/PrevSlicePageCounter and SlicePageCounter, like below in your style:
Code: Select all
Next: <Field: NextSlicePageCounter>, Prev: <Field: PrevSlicePageCounter>, Current: <Field: SlicePageCounter>
and let me know so I can take a look on your site what these fields contains at the bounderies...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Andross » Mon Dec 05, 2005 9:08 pm

Code: Select all
<PerlCode>
$PrevLink = ($PrevFileURL && ($PrevSlicePageCounter < $SlicePageCounter)) ? qq~<A HREF="$PrevFileURL"><< PREVIOUS PAGE</A>~:'';
$NextLink = ($NextFileURL && ($NextSlicePageCounter > $SlicePageCounter)) ? qq~<A HREF="$NextFileURL">NEXT PAGE >></A>~:'';
</PerlCode>


Just to confirm to you I used the code. I will see what happens when I insert those fields btw.

edit: here's the print out...I suspect something is pretty wrong with it =P

Next: 1, Prev: 1, Current: 1
Link to page: http://www.zappoartblog.com/portfolio/g ... -crisp.php

And it's like that on all other pages.

Here is the style I am using:

Code: Select all
<PerlCode>
$PrevLink = $PrevFileURL ? qq~<a href="$PrevFileURL">&laquo; <Field: PrevSliceValue2></a>~:'';
$NextLink = $NextFileURL ? qq~<a href="$NextFileURL"><Field: NextSliceValue2> &raquo;</a>~:'';
</PerlCode>

<a id="thumbphoto" href="<MaginotURL: fullphotos>"><img src="<FilePath: CustomField_Photothumb>" alt="<Field: Subject>" /></a>

<h3><Field: PrevLink> <Field: SliceValue2> <Field: NextLink></h3>

<hr /><br />

<h1><Field: Subject></h1>
<h2>Medium: <Field: CustomField_Medium></h2>
<h3>&copy; Andrew Hefter 2005</h3>

<ul id="photomenu">
<li><a href="<MaginotURL: fullphotos>"><b>zoom in</b></a> |</li>
<li><a href="/portfolio/gallery/<Field: SliceValue1>.php"><Field: Category> gallery</a> |</li>
<li><a href="/portfolio/index.php?id=gallery">gallery index</a> |</li>
<li><a href="/portfolio/index.php">home</a></li>
</ul>

<p>

<Field: Text><br /><br />

<b>Camera Info.:</b><br />
<Field: CustomField_Info><br />

<hr /><br /><br />

   
Next: <Field: NextSlicePageCounter>, Prev: <Field: PrevSlicePageCounter>, Current: <Field: SlicePageCounter>
<h3><Field: PrevLink> <Field: SliceValue2> <Field: NextLink></h3>
</p>


Note that with the <PerlCode> at the top, when I tried that second example, I ONLY replaced that portion. Was an adjustment to the fields required at all? (As in, <Field: PrevLink>, etc.)
User avatar
Andross
 
Posts: 138
Joined: Wed Jun 30, 2004 7:22 pm

Postby Parahead » Tue Dec 06, 2005 7:57 pm

Andross wrote:
Code: Select all
<PerlCode>
$PrevLink = ($PrevFileURL && ($PrevSlicePageCounter < $SlicePageCounter)) ? qq~<A HREF="$PrevFileURL"><< PREVIOUS PAGE</A>~:'';
$NextLink = ($NextFileURL && ($NextSlicePageCounter > $SlicePageCounter)) ? qq~<A HREF="$NextFileURL">NEXT PAGE >></A>~:'';
</PerlCode>


Just to confirm to you I used the code. I will see what happens when I insert those fields btw.

edit: here's the print out...I suspect something is pretty wrong with it =P

Next: 1, Prev: 1, Current: 1
Link to page: http://www.zappoartblog.com/portfolio/g ... -crisp.php

And it's like that on all other pages.
Hmm... I do understand why it is like that, the counters was created before the multiple sliced option was introduced and it seems that this is something to look into for me...

Anyway, try this code out then and let me know if it works for you:
Code: Select all
<PerlCode>
$PrevLink = ($PrevFileURL && ($PrevSliceValue1 eq $SliceValue1)) ? qq~<A HREF="$PrevFileURL"><< PREVIOUS PAGE</A>~:'';
$NextLink = ($NextFileURL && ($NextSliceValue1 eq $SliceValue1)) ? qq~<A HREF="$NextFileURL">NEXT PAGE >></A>~:'';
</PerlCode>
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Andross » Thu Dec 08, 2005 1:44 am

Success! Thanks a ton man :)
User avatar
Andross
 
Posts: 138
Joined: Wed Jun 30, 2004 7:22 pm


Return to Addon Release and Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron