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 9th, 2011, 09:55 PM
patagonia patagonia is offline
 
Join Date: May 2009
Posts: 506
Default Embedding a View in a .php page

Along the same lines as you have the option to "embed a view in a post"... I want to do the same thing, but need the php code, to be able to embed a view, from within the php code of a page (if this is possible).

So what I want to be able to do:

On some sites, it would be nice to have my datafeedr store categories outputted above my latest blog posts.
So instead of the home page of my site, pointing at the datafeedr store homepage, I want to have the home page of my site, be my latest blog posts, but above those, output my datafeedr store categories. I would have to go into the main.php file or whichever one it is, and add the code to output a custom view, above the latest posts loop.

Is this possible?
  #2  
Old January 9th, 2011, 10:33 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Yes, it's possible and pretty straightforward.

The first thing you need to know about is this:
PHP Code:
<?php echo datafeedr_tag(); ?>
That function will display most of your views (doesn't currently work with widgets at this time) anywhere on your site when called from your .php files.

Here are a few examples:

This embeds your store's homepage anywhere you want (not sure how useful that is):
PHP Code:
<?php echo datafeedr_tag("home"); ?>
Embed a product details page for a single product:
PHP Code:
<?php echo datafeedr_tag('product?p=850801159528968')?>
With this you can embed a category list:
http://www.datafeedr.com/forums/show...65&postcount=2

Or you can embed any custom view that you create by following this pattern:
PHP Code:
<?php echo datafeedr_tag("Custom View Name"); ?>
Embed a category page anywhere in your .php files:
PHP Code:
<?php echo datafeedr_tag("category?c=514253"); ?>
Embed your Sales Items custom view anywhere:
PHP Code:
<?php echo datafeedr_tag("Sale Items"); ?>
The real power is when you create new custom views to handle small tasks such as displaying a category list.

Eric
  #3  
Old January 9th, 2011, 10:44 PM
patagonia patagonia is offline
 
Join Date: May 2009
Posts: 506
Default

Great I look forward to being able to do that.
After all the playing around tonight, I have a lot more questions... but they will have to wait until manana. 1am and bed is calling.
  #4  
Old March 7th, 2011, 08:45 PM
pnewcomb pnewcomb is offline
 
Join Date: Feb 2011
Posts: 6
Default

I'm having trouble with this.

I'm using the tag:
PHP Code:
<?php echo datafeedr_tag("Custom View Name"); ?>
with my custom view in there, and it's setup to show 3 columns of 6 products. The problem is that it's showing the full product image, details, and everything, without the css styling and truncation. What am I doing wrong? My site is http://www.example.com and it's the part below the featured area and to the left.

Last edited by pnewcomb : March 7th, 2011 at 08:51 PM.
  #5  
Old March 7th, 2011, 08:58 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

You need to go here: The Factory > Your Store > VIEWS > CUSTOM VIEWS > Custom View Name > View Properties and add view to the Custom CSS ID field.

Eric
  #6  
Old March 7th, 2011, 09:06 PM
pnewcomb pnewcomb is offline
 
Join Date: Feb 2011
Posts: 6
Default

Thanks Eric, that worked like a charm!
  #7  
Old April 11th, 2011, 08:37 AM
fuzzone fuzzone is offline
 
Join Date: Dec 2010
Posts: 11
Default

Hi!
I tried to add
Quote:
<?php echo datafeedr_tag("home"); ?>
to my home page, but getting this
Quote:
Fatal error: Call to undefined function datafeedr_tag() in /homepages/29/d161728157/htdocs/diamond-connoisseurs/wp-content/themes/default/home_page.php on line 244
  #8  
Old April 11th, 2011, 09:02 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by fuzzone View Post
Hi!
I tried to add to my home page, but getting this
What version of the plugin are you using?
 


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
Add a View Library ayorofrance Feature Requests 0 January 9th, 2011 07:08 AM


All times are GMT -5. The time now is 07:13 AM.


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