Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 24th, 2012, 03:45 PM
Camden Camden is offline
 
Join Date: Aug 2011
Posts: 19
Default Use Category Description as Category Link

Hi,
I would like to enter custom links for some, but not all, of my categories. It looks like I can add the link to the category.description field (using <a href command).

How would I add code to my category list module to check for the custom link in category.description? If it is not there, I would want to display the normal category.link field.

Thanks!

Last edited by Camden : January 24th, 2012 at 03:46 PM.
  #2  
Old January 24th, 2012, 04:15 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

You could use PHP's preg_match() function to search for the link within the category's description. You would need to pass $category->description into the preg_match() function. You can't pass Datafeedr tags into the function so [category.description] won't work.

Eric
  #3  
Old January 25th, 2012, 03:57 PM
Camden Camden is offline
 
Join Date: Aug 2011
Posts: 19
Default

Eric,
Thanks so much for your quick reply! I don't think I'm brave (or smart) enough to do that, however...

To clarify, the only thing I would have in the category description would be the custom link. So would I really need to search for the link? I was hoping it would be possible to see if there's anything in the category description, and if so, use that category description field for the category link field in the category list module. If the category description field is blank, I would just use the category link field.

I played around quite a bit with this today, but didn't get anywhere.

Thanks again for your help...
  #4  
Old January 25th, 2012, 04:00 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Sure, you could just see if the category description was longer than 7 characters and if it was assume that it was your special link:

PHP Code:
if (strlen($category->description) > 7) {
// this is a custom link ...
} else {
// this is a standard store category link

Eric
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
product category link JoanaMarie Questions 4 August 5th, 2011 03:45 PM
Category Description doggybiz Problems 2 January 25th, 2011 11:11 AM


All times are GMT -5. The time now is 10:40 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.