Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   Using pagination with Categorty SHortcode (/showthread.php?t=9032)

youngy April 29th, 2013 06:37 AM

Using pagination with Categorty SHortcode
 
HI Eric,
Can you please advise what im doing wrong here:

http://golfing-warehouse.com/woods/

The category products display fine, but if you click on the pagination i get a 404.

Do I need to tweak the url settings in the factory of something?

Also incase you need to know I have set my permalinks to:

/%category%/%postname%/

Cheers Mate

Dave

Eric April 29th, 2013 07:49 AM

Hi Dave,

That's an embedded view. Pagination doesn't work on embedded views.

Here's your store's category page where pagination does work: http://golfing-warehouse.com/store/category/mens/

Eric

youngy April 29th, 2013 08:02 AM

Hi Eric,
HHmm right ok.

SO how can I make this work then? If i cant have the pagination work via the shortcode, what other options do I have?

You can see how im trying to put a product list their on a category page which I will bulk up with unique content around the list itself. Ideally blocking the list no follow etc, so it doesnt go against me for duplicate content.

Is there anyway at all I can display all the products on my list on that page? -

http://golfing-warehouse.com/mens/woods

Eric April 29th, 2013 08:05 AM

Hi,

Pagination on embedded views doesn't work. There's no fix for that.

Your only option if you want to show all products in an embedded view is to display all products on 1 page. However this is not ideal as you have over 500 products in the "Mens" category.

Eric

youngy April 29th, 2013 08:12 AM

Hi Eric,
Ok im stuck. Ive set up all these categories in the factory with the aim of using shortcode to display each category set.

Now seeing as I cant use pagination via shortcode, does this therefore mean I cannot paginate at all then with the method I want?

I have to be able to paginate somehow in this way as this is the best possible way to seo each page.

youngy April 29th, 2013 08:14 AM

Hows about where it says :

Pages: 1 2 3 4 5 6 7 8 9 next pagelast page

As page 1 displays correctly on the category page, is there anything I can change on teh views so if someone clicks page 2, 3 4 etc itll go to the "store/"? taking them to the correct page for the rest of the products?

Eric April 29th, 2013 08:34 AM

Hi,

Why not remove pagination from those views (the view that you are embedding) and just add a link at the bottom of the view that says "View more..." or "View next 18 products". That link will take the user to the store category page.

You can create a link to Page 2 of the specified category page like this:

Code:

<a href="<?php echo dfr('url')->query_to_url('page=2&view=category&c='.$category->id); ?>">View more</a>
I would suggest creating a new custom view. Name it something like embedcats.

Add a Product list module to the view.

Add the Product List template code to the view. So you might have something like this:

HTML Code:

<a href="<?php echo dfr('url')->query_to_url('page=2&view=category&c='.$category->id); ?>">View more</a><br />

<!-- Product List -->
<div class="pl">
  [product.each]
  <div class="t1 col3">
  <div class="bdr">
    <h2><a href="[product.link]" title="[product.name]">[product.name]</a></h2>
    <div class="thmb"><a href="[product.link]" title="[product.name]">[product.thumbnail tag='1']</a></div>
    <div class="prc">[product.currency mode="sign"][product.price]</div>
    <p class="desc">[product.description]</p>
    <div class="btns">
    <a href="[product.link]" title="View details of [product.name]" class="dfbutton dforange dfmedium dfrounded">Details</a>
    </div>
    <div class="clearingdiv"> </div>
  </div>
  </div>
  [/product.each]
  <div class="clearingdiv"> </div>
</div>
<!-- /Product List -->

<a href="<?php echo dfr('url')->query_to_url('page=2&view=category&c='.$category->id); ?>">View more</a>

Then on your pages in your blog, you would embed like this:

Code:

[DFR:embedcats?c=605386]
Eric

youngy April 29th, 2013 09:29 AM

HI Eric,
That sgreat I think this might sort it out.

Omk ive been paying with it, ive doen something silly here and basic.

Its all set up the way I want it however I cant seem to get the product list as it should look on the category page between the 2 x "view more".

I need to add the product list code to my embed shortcode here right? It dont seem to be working..what am I doing wrong?

http://golfing-warehouse.com/mens/woods/

Eric April 29th, 2013 09:39 AM

Hi,

Oh yeah, forgot to mention about that.

1. Go here: The Factory > Your Store > VIEWS > CUSTOM VIEWS > embedcat > View menu > View Properties.

2. In the CSS ID field, add the word: view

3. Save and click the [Update Settings Only] button.

Eric

youngy April 29th, 2013 09:50 AM

Fantastic Eric! We've cracked it! Im happy with that!

One thing though mate, I want to "no follow" all links to the store, including view more, product images etc - every single link.

Is there a easy way to do this either factory or website side where it blocks the search engine from indexing these pages?

Im guessing doing this will stop any triplicate issues, so the only pages that will get indexed are the ones on wordpress right?

Eric April 29th, 2013 09:54 AM

Hi,

If you want all pages in your store to not be indexed, do this: /show...0368#post40368

Eric

youngy April 29th, 2013 10:03 AM

Great Thanks Eric,
I have now done this.

Couple of quick questions please:

How can I test this has worked.

Also im no programmer I accept that, but in the line of code:

<?php if (is_dfr()) : ?><meta name="robots" content="noindex,nofollow" /><?php endif; ?>


WHats it actually saying, id expect /store to be there somwhere?

Eric April 29th, 2013 10:09 AM

Hi,

It's currently not working.

In your header.php file, find this tag: </head>

Then add the code above to right above the </head> tag like this:

HTML Code:

<?php if (is_dfr()) : ?><meta name="robots" content="noindex,nofollow" /><?php endif; ?>

</head>

Eric

youngy April 29th, 2013 10:12 AM

Hi Eric,
Ok thats exactly what i did. Maybe I didnt save it, does it work for you now?

Eric April 29th, 2013 10:14 AM

Hi,

No it's not working and it's still appearing in the wrong place in your shortcode. Make sure you remove the first line of code you pasted in there.

Also, if you are using a caching plugin, be sure to clear the cache.

Eric

youngy April 29th, 2013 10:21 AM

OK mate I think ive got it.

You know theres 2 /head tags on the header.php?? Its a bit confusing.

Eric April 29th, 2013 10:31 AM

It's still not working. Can you PM me login details for your blog?

Eric April 29th, 2013 10:42 AM

Hi,

You were putting the code into a commented out area. For example, you had your code like this (all of the orange code is commented out):
PHP Code:

<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?><!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php
    
/*
     * Print the <title> tag based on what is being viewed.
     */
    
global $page$paged;

    
wp_title'|'true'right' );

    
// Add the blog name.
    
bloginfo'name' );

    
// Add the blog description for the home/front page.
    
$site_description get_bloginfo'description''display' );
    if ( 
$site_description && ( is_home() || is_front_page() ) )
        echo 
" | $site_description";

    
// Add a page number if necessary:
    
if ( $paged >= || $page >= )
        echo 
' | ' sprintf__'Page %s''twentyeleven' ), max$paged$page ) );

    
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php
    
/* We add some JavaScript to pages with the comment form
     * to support sites with threaded comments (when in use).
     */
    
if ( is_singular() && get_option'thread_comments' ) )
        
wp_enqueue_script'comment-reply' );

    
/* Always have wp_head() just before the closing 

<?php if (is_dfr()) : ?><meta name="robots" content="noindex,nofollow" /><?php endif; ?>

</head>
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to <head> such
     * as styles, scripts, and meta tags.
     */
    
wp_head();
?>

</head>

This is the code you needed:
PHP Code:

<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?><!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php
    
/*
     * Print the <title> tag based on what is being viewed.
     */
    
global $page$paged;

    
wp_title'|'true'right' );

    
// Add the blog name.
    
bloginfo'name' );

    
// Add the blog description for the home/front page.
    
$site_description get_bloginfo'description''display' );
    if ( 
$site_description && ( is_home() || is_front_page() ) )
        echo 
" | $site_description";

    
// Add a page number if necessary:
    
if ( $paged >= || $page >= )
        echo 
' | ' sprintf__'Page %s''twentyeleven' ), max$paged$page ) );

    
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php
    
/* We add some JavaScript to pages with the comment form
     * to support sites with threaded comments (when in use).
     */
    
if ( is_singular() && get_option'thread_comments' ) )
        
wp_enqueue_script'comment-reply' );

    
/* Always have wp_head() just before the closing 



</head>
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to <head> such
     * as styles, scripts, and meta tags.
     */

    
wp_head();
?>

<?php if (is_dfr()) : ?><meta name="robots" content="noindex,nofollow" /><?php endif; ?>

</head>

Eric

youngy April 29th, 2013 10:45 AM

ha! Damn I knew i was doing something really stupid!!

OK mate so its all working now, no store pages will get indexed, just my blog pages?

If so great! Im good to go! :)

youngy April 29th, 2013 10:47 AM

One last question mate:

You know how my usres start off on my "blog" then they can click here and they get sent over to the "store".

Is it possible that the widgets, side bars can change once they go over to store? This way they can use the store more effectively?

Eric April 29th, 2013 10:56 AM

Hi,

Yes, I think all is set correctly. You just need to adjust your Privacy settings before you launch: Settings > Privacy

Yes, you just need to edit your Store page and under Page Attributes > Templates choose Sidebar Template

Eric

youngy April 29th, 2013 11:03 AM

Hi Eric,
Yes i did that deliberately so nothing got ranked as I was building it. Ill get a bit of content on there now and then make it indexabile.

Thats great Ill have a play around with that. Im hoping now Ive worked out the best way to build a datafeedr site with seo and indexing in mind etc.

Time to get cracking now!

Many Thanks for your help

Dave

youngy June 20th, 2013 10:36 AM

HI Eric,
I just wanted to confirm something using this code:

<?php if (is_dfr()) : ?><meta name="robots" content="noindex,nofollow" /><?php endif; ?>

If i put this in my header.php file. This will block ONLY the /store and any other paths with /store in it?

Im just confused as doesn't this code just block the robots and therefore block the whole of my site? Which is definitely not what i want.

Infact i want EVERYTHING indexing apart from domain.com/store - basically everything what datafeedr delivers.

Eric June 20th, 2013 10:43 AM

Hi,

Using the PHP code is_dfr() returns true for any page Datafeedr delivers. This includes search pages, category pages, custom datafeedr pages, product pages, etc...

After adding it you should view source on the pages you DON'T want blocked just to be sure.

Eric

youngy June 20th, 2013 10:52 AM

OK Cheers mate that clears it up now


All times are GMT -5. The time now is 01:17 PM.

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