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 May 31st, 2012, 09:26 AM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default Custom View Parameters - how to read them?

Hi - here's an example link:

http://www.fitness-saver.com/2012/05...nt-abdominals/

From there you can see we have really cool use of the [DFR:customview?name=something&price=10-100] shortcodes.

One thing I would really love to add is a hyperlink from within the custom view which takes the user to similar products. e.g. Our custom view is called 'AddProducts' and if you imagine we had the following:

[DFR:AddProducts?name=treadmill&price=6000-]

Then it will show 5 treadmills upwards of 6000. What I would like is the ability from within the view to identify the ?name=treadmill and ?price=6000- parameters. If I could access those, then I would be able to add a hyperlink (we'll make it stylish too like our custom views) which goes like this:

<a href="/fitness-store/search/?name=treadmill&price=6000->View all</a>

If it's not possible, please let me know as I can just give content editors some standard code to create for their DFR shortcodes and then they have to modify the search query in two places is all.

Thanks,
Dave
  #2  
Old May 31st, 2012, 09:31 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I understand what you want to do but I don't understand where the ?name=treadmill and ?price=6000- parameters are coming from... Are you manually adding those for each post?

Eric
  #3  
Old June 1st, 2012, 11:58 AM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

Yes - say for example we write a Mountain Bike Buying Guide, then we could have 4 or 5 different types of bikes that we cover in the buying guide and we would insert this [DFR:AddProduct...] shortcode 4 or 5 times.

We intend to add these manually to *most* of our posts to create a nice link right through to the shop from the posts.
  #4  
Old June 1st, 2012, 11:59 AM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

And specifically, regarding the ?name=treadmill and ?price=6000- parameters, these were chosen so that we could identify treadmills with TVs. We found it impossible to do this using the text description - e.g. ?name and ?description do not play nicely together in these [DFR:custom views]
  #5  
Old June 1st, 2012, 12:32 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Adding the following code to the AddProduct's Product List module should do the trick:

Code:
<?php 
$name = $s->request->params->name;
$price = $s->request->params->price;
?>
<a href="[server.url query='view=search&amp;name=$name&amp;price=$price']">View all</a>
Eric
  #6  
Old June 4th, 2012, 02:28 PM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

Thanks - that helped a lot. In the end, I ended up using PHP to write the query and I added in a lot more parameters. Here's what I ended up with so far:

<?php
$name = rawurlencode($s->request->params->name);
$price = rawurlencode($s->request->params->price);
$word = rawurlencode($s->request->params->word);
$description = rawurlencode($s->request->params->description);
$brand = rawurlencode($s->request->params->brand);
$merchant = rawurlencode($s->request->params->merchant);
$caption = $s->request->params->caption;
?>

And then under the products, before the clearing div:

<div class="productcaption"><?php echo $caption ?></div><div class="moreproductslink">
<a rel="nofollow" href="/fitness-store/search/?name=<?php echo $name.'&price='.$price.'&word='.$word.'&descriptio n='.$description.'&brand='.$brand.'&merchant='.$me rchant; ?>" >View all</a>
</div>

Then I've styled those to float left and right - the finished result can be seen here:

http://www.fitness-saver.com/2012/05...-buyers-guide/

Thanks!
  #7  
Old June 4th, 2012, 02:55 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Looks great! Thanks for sharing.

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
Custom View Question erin Questions 1 October 22nd, 2011 08:08 AM
Custom View not working dtmcollins Problems 3 September 5th, 2011 07:15 AM
one custom view for many categories? charlesk Questions 7 August 11th, 2011 08:52 AM
Custom View Will Not Format Correctly laura90059 Problems 1 March 24th, 2011 06:15 PM
Custom view for select pages Kaetemar Questions 1 February 10th, 2011 07:11 PM


All times are GMT -5. The time now is 12:55 PM.


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