Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Tips, Tricks & Tutorials
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
Prev Previous Post   Next Post Next
  #1  
Old June 19th, 2012, 09:28 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default Store page conditional functions to use in your theme's PHP template files.

We've added a few new functions to determine what page of the store you are on if you are editing your theme's PHP template files.

Here are the basics:

is_dfr() - returns true if we're on a Datafeedr page
is_dfr('home') - returns true if we're on the store's front page
is_dfr('category') - returns true if we're on a store category page
is_dfr('product') - returns true if we're on a store product details page

Here are some basic usages that you could use in your theme's templates (a basic understanding of PHP is required):

Show something if we're viewing any page within the store:

PHP Code:
<?php if (is_dfr()) : ?>
    We're on a store page.
<?php endif; ?>
Show something only if we're on a product details page:

PHP Code:
<?php if (is_dfr('product')) : ?>
    You're viewing a single product in the store.
<?php endif; ?>
Show something if we're viewing a category page, show alternative message if we're not:

PHP Code:
<?php if (is_dfr('category')) : ?>
    You're viewing a category page in the store.
<?php else : ?>
    You're NOT viewing a category page in the store.
<?php endif; ?>
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
For store front page and any other view theme didn`t applied dvtornikov Problems 1 February 15th, 2012 11:06 PM
How do I remove store page title from atahualpa theme? sean83 Problems 1 September 9th, 2011 09:15 AM
Update template files only option ccgmark Feature Requests 2 January 13th, 2011 09:51 AM


All times are GMT -5. The time now is 04:07 PM.


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