Mango



Thread: More Multicategory

Created on: 07/30/12 11:50 PM

New topic Reply    Page: 1  

Replies: 1
markmandel


markmandel's Gravatar
Joined: 09/29/09
Posts: 21

07/30/12 11:50 PM

So I went hunting - Lara, it does look like you did implement multicategory, however, the magical piece is that it needs to be:

/archive.cfm/multicategory/do-it-yourself,free-stuff


NOT

/archive.cfm/category/do-it-yourself,free-stuff


(Which is no big deal, I can 301 redirect from my old hack job).

However - there is a bug (least I think so). I have pagination set up in my skin like so:

<div class="navigation">

<span class="previous-entries">

<mango:ArchiveProperty ifHasNextPage><a href="<mango:ArchiveProperty link pageDifference="1" />">Previous Entries</a></mango:ArchiveProperty></span>

<span class="next-entries">

<mango:ArchiveProperty ifHasPreviousPage ifHasNextPage>

<img src="/skins/edc/assets/images/nav-icon.png" width="26" height="27"/>

</mango:ArchiveProperty>

<mango:ArchiveProperty ifHasPreviousPage><a href="<mango:ArchiveProperty link pageDifference="-1" />">Next Entries</a></mango:ArchiveProperty></span>

</div>


Normally, works fine. However for multicategory it doesn't keep the link, it links to:

/archives.cfm/page/1


Going to dig into why that is, but figured you should know.
Link | Top | Bottom
markmandel


markmandel's Gravatar
Joined: 09/29/09
Posts: 21

07/31/12 11:24 PM

Looks like I worked out the bug.

This way I can still use /archive.cfm/category/do-it-yourself,free-stuff

Here is the diff (you know this would be much easier to push to github :) )

diff --git a/tags/mango/Posts.cfm b/tags/mango/Posts.cfm

index e5596c4..0351683 100644

--- a/tags/mango/Posts.cfm

+++ b/tags/mango/Posts.cfm

@@ -60,8 +60,8 @@ COMMENTCOUNT-ASC, COMMENTACTIVITY-DESC, COMMENTACTIVITY-ASC --->

               <cfset attributes.categoryName = data.currentArchive.getCategory().getName() />         

            </cfcase>

            <cfcase value="multicategory">

-               <cfset attributes.categoryName = data.currentArchive.category />

-               <cfset attributes.categoryMatch = data.currentArchive.match />      

+               <cfset attributes.categoryName = data.currentArchive.getCategory() />

+               <cfset attributes.categoryMatch = data.currentArchive.getMatch() />

            </cfcase>         

            <cfcase value="date">

               <cfset attributes.year = data.currentArchive.getYear() />


diff --git a/components/model/CategoryArchiveWrapper.cfc b/components/model/CategoryArchiveWrapper.cfc

index 57638de..3a46586 100644

--- a/components/model/CategoryArchiveWrapper.cfc

+++ b/components/model/CategoryArchiveWrapper.cfc

@@ -53,7 +53,7 @@

   </cffunction>



<!--- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --->

-   <cffunction name="getCategory" access="public" returntype="Category" output="false">

+   <cffunction name="getCategory" access="public" returntype="any" output="false">

      <cfset var event = ""/>

      <cfset var eventData = structnew() />

      <cfset eventData.originalObject = variables.myObject />
Link | Top | Bottom

New Post

Please login to post a response.