Hi Tomek!!!!!!
No words!!!!!! Such a great help!
Thanks a lot!!!!!!!!
Mika
On Nov 17, 4:12 am, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> Mika,
>
> fu.cfc I believe is too general for your case. I just checked it, and what I
> mean is "setFriendlyURL" on line 1492 in core/packages/types/types.cfc. Copy
> that entire function into your type, and then edit around line 1534.
> Actually, here is what I do for the dmEvents type. You'll notice it is
> exactly the same as the function in types/types.cfc except for the last 5
> lines or so. Just change the slashes to dashes and you should be set.
>
> After you copy that in and save (or configure how you want the FU to look),
> then go to the webtop, update the coapi metadata and then recreate the FU's
> for that type.
>
> Best,
>
> Tomek
>
> <cffunction name="setFriendlyURL" access="public" returntype="struct"
> hint="Default setfriendlyurl() method for content items." output="false">
> <cfargument name="objectid" required="false"
> default="#instance.stobj.objectid#" type="uuid" hint="Content item
> objectid.">
> <cfset var stReturn = StructNew()>
> <cfset var stobj = getdata(arguments.objectid)>
> <cfset var stFriendlyURL = StructNew()>
> <cfset var objFU =
> CreateObject("component","#Application.packagepath#.farcry.fu")>
> <cfset var objNavigation =
> CreateObject("component","#Application.packagepath#.types.dmNavigation")>
> <cfset var qNavigation=querynew("parentid")>
>
> <!--- default return structure --->
> <cfset stReturn.bSuccess = 1>
> <cfset stReturn.message = "Set friendly URL for
> #arguments.objectid#.">
>
> <cfif not
> listcontains(application.config.fusettings.lExcludeObjectIDs,arguments.objectid)>
> <!--- default stFriendlyURL structure --->
> <cfset stFriendlyURL.objectid = stobj.objectid>
> <cfset stFriendlyURL.friendlyURL = "">
> <cfset stFriendlyURL.querystring = "">
>
> <!--- This determines the friendly url by where it sits in the
> navigation node --->
> <cfset qNavigation = objNavigation.getParent(stobj.objectid)>
>
> <!--- if its got a tree parent, build from navigation folders
> --->
> <!--- TODO: this might be better done by checking for
> bUseInTree="true"
> or remove it entirely.. ie let tree content have its
> own fu as well as folder fu
> or set up tree content to have like page1.cfm style
> suffixs
> PLUS need collision detection so don't overwrite
> another tree based content item fro utility nav
> PLUS need to exclude trash branch (perhaps just from
> total rebuild?
> GB 20060117 --->
> <cfif qNavigation.recordcount>
> <cfset stFriendlyURL.friendlyURL =
> objFU.createFUAlias(qNavigation.parentid)>
>
> <!--- otherwise, generate friendly url based on content type
> --->
> <cfelse>
> <cfif
> StructkeyExists(application.types[stobj.typename],"displayName")>
> <cfset stFriendlyURL.friendlyURL =
> "/#application.types[stobj.typename].displayName#">
> <cfelse>
> <cfset stFriendlyURL.friendlyURL =
> "/#ListLast(application.types[stobj.typename].name,'.')#">
> </cfif>
> </cfif>
>
> <!--- set friendly url in database --->
> <cfset stFriendlyURL.friendlyURL = stFriendlyURL.friendlyURL &
> "/#DateFormat(stObj.startDate,'yyyy')#/#DateFormat(stObj.startDate,'mm')#/#DateFormat(stObj.startDate,'dd')#/#stobj.label#">
> <cfset objFU.setFU(stFriendlyURL.objectid,
> stFriendlyURL.friendlyURL, stFriendlyURL.querystring)>
>
> <cflog application="true" file="futrace"
> text="types.setFriendlyURL: #stFriendlyURL.friendlyURL#" />
> </cfif>
>
> <cfreturn stReturn />
> </cffunction>
>
> On Sun, Nov 16, 2008 at 3:40 AM, smika <[EMAIL PROTECTED]> wrote:
>
> > Thanks a lot,
>
> > I'll check this out and will post on it. I am using FC5, and it looks
> > to me that here fu.cfc is handling that.
>
> > Mika
>
> > On Nov 15, 6:02 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> > > what you need to do is extend the dmNews object into your own folder.
> > There,
> > > copy the "createFriendlyURL" (or similarly named function) from either
> > the
> > > dmNews type definition or the types definition. Then you can find where
> > it
> > > actually sets the FU and change it to your hearts content. I do it all
> > the
> > > time!
>
> > > Tomek
>
> > > On Sat, Nov 15, 2008 at 6:34 AM, smika <[EMAIL PROTECTED]> wrote:
>
> > > > Dear friends,
>
> > > > We've setup friendly URL for our web sitewww.reporter.amand
> > > > everything is working fine.
> > > > But now there is a request to meet the FU to the standards for Google
> > > > news.
> > > > So instead of
> > > >http://www.reporter.am/go/article/coming-to-terms-with-the-events-of-.
> > ..
> > > > we should get:
>
> > > >http://www.reporter.am/go/article/2008-11-14-coming-to-terms-with-the.
> > ..
>
> > > > e.g. get dateposted in front of url.
>
> > > > How i can do this?
>
> > > > Thanks a lot,
>
> > > > Mika
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---