Display Help

Hi,
I just have a few little issues with the way products are being displayed in the marketplace.
1. How could I restrict the number of characters displayed for the title? I have set the hight of the grid for products, and if the product title is too long, it pushes the image and the product down and out of the box.
2. How would I set the size of the image that is used? I have some products with small images, most are perfect, and then some don't seem to be thumbnails at all. I have included a screenshot.
3. How would I use wp_title to set the name of the page? I haven't used the template to create a page, so the page doesn't have any title.
Thanks.

  • Mason
    • DEV MAN’s Sidekick

    Hiya Fondeli,

    I'm assuming you're referring to the Network theme here?

    1. How could I restrict the number of characters displayed for the title?

    Replace:
    <?php the_title(); ?>

    with something like this (will print 50 characters of the title):
    <?php echo 'shortened title ' .substr($post->post_title,0,50) ; ?>

    2. How would I set the size of the image that is used?

    Gotta link to that? The theme should auto-size all the images for you automatically.

    3. How would I use wp_title to set the name of the page?

    Kinda confused on this one. What page are you referring to?

  • Fondeli
    • The Bug Hunter

    Hi Mason,

    Yes the network theme.

    1. How would I get that the_title working with marketpress, this is the code I have:
    <?php mp_list_global_products('text=none&paginate=1&page=0&per_page=25&order_by=rand'); ?

    2. Have a look here: http://fondelifair.com/marketplace/categories/jewellery/ though there are a few more instances of the image being too big.

    3. What I want to do here is add the category to the browser tab....what I have at the moment is Fondelifair | and what I would like is Fondelifair | Marketplace for example, or Fondelifair | Accessories etc.

  • DavidM
    • DEV MAN’s Mascot

    Hi Fondeli,

    First off, that's quite an awesome grid display!

    Seeing as the grid is a custom one, could you let me know how that's being done? Is it being done via a customization of mp_list_global_products() ?

    That said, regarding both your title concerns, would it be feasible to use the SEO plugin?
    https://premium.wpmudev.org/project/wpmu-dev-seo

    If supports custom post types, so my guess is that it would completely resolve those concerns.

    Cheers,
    David

  • Fondeli
    • The Bug Hunter

    Thanks David! :slight_smile:

    No I did it with css in the child theme, so the mp_list_global_products is just as is. I created a mp_global_products.php file. So I didn't actually make it a template or anything, should I? I just made a php file for each category, so there is no templates being used at all. Would I be able to use the seo plugin in this instance?

    I am confused by the SEO plugin...well SEO in general...is there a good guide on using it?

    Thanks!

  • DavidM
    • DEV MAN’s Mascot

    Hi Fondeli,

    Sorry this one took me a moment. WPMU DEV SEO does support the MarketPress product custom post type along with its taxonomies (product categories) so you can specify the titles as such.

    We're in the process of working out some tutorials for the plugin but in this particular case here, I believe it would be as simple as going with all the default settings and then customizing Step 3 as follows.

    Navigate to the Step 3 tab.

    Scroll down the page and customize the Product title.

    Scroll further down the page and customize the Product Category and Tag titles.

  • DavidM
    • DEV MAN’s Mascot

    Hi Fondeli,

    I believe I missed some crucial statements you made regarding these pages. They're regular php pages you made based off one of the theme's templates (perhaps page.php), correct?

    Given the nature of that case, I believe you can simple use regular html tags like this:
    <title>Your Title</title>

    If you've got a separate php page for each category I believe that should do it. Have you tried that?

    Cheers,
    David

  • Fondeli
    • The Bug Hunter

    Back with yet another problem!

    The marketplace page that I created using the mp_product_list.php file is showing up stuck to the left side on internet explorer! Is there anything I can do to move it to the center?

    Also I am wondering about shortening the product titles, I have found how to shorten titles, but since I don't actually call the name, just the function, I am at a loss how to implement it.

    Thanks.

  • Fondeli
    • The Bug Hunter

    I now have yet another problem...since removing the title this morning I have noticed that some of the pages are behaving strangely...so this is what I want the category pages to look like: http://fondelifair.com/marketplace/categories/accessories/ but some of the pages are coming out like this: http://fondelifair.com/marketplace/categories/candles/
    Now these two pages have exactly the same code. I have used the firebug and I can't find anything, I have tracked it into the mp_product_list function, but can't get any further than this....
    Is there any way you could tell me what the problem is? Will I ever get these pages to behave themseleves?

    Thanks.

  • DavidM
    • DEV MAN’s Mascot

    Hi Fondeli,

    Been a bit busy over here lately, sorry for the delay! I believe the following addition to your css rules should easily cover your issue with the product names:

    #marketpress-grid .mp_product_name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    }

    As for the title tags, I was under the impression that you had custom php pages for these, but I'm now venturing to guess you're actually using page templates. Is that correct?

    Cheers,
    David

  • Fondeli
    • The Bug Hunter

    Thank you David!

    That is amazing...product list looks great now!! :slight_smile:

    To be honest I don't know what you would call what I have done, and what's the difference between custom php pages, and page templates? I'm sorry, I've only been at this a short time. Here it is:

    <?php get_header() ?>
    <div id="container-background">
    	<div id="content"><!-- start #content -->
    		<div class="padder">
    		<h2>Marketplace</h2>
    		<div id="columns" style=" float: left;">
    			<div id="left-column" style="float: left; width: 15%;">
    			<h3>Categories</h3>
    
    </div>
    <div id="right-column" style="float: left; width: 85%;">
    
    			<?php if (function_exists('easing_slider')){ easing_slider(); }; ?>
    
    		<div id="market-grid">
    
    		<?php mp_list_global_products('text=none&paginate=1&page=0&per_page=20&order_by=rand'); ?>
    <div class="footer">&nbsp;</div>
    		</div>
    		</div>
    		</div>
    </div>
    	</div><!-- end #content -->
    	<div class="clear">
    	</div>
    
    <?php get_footer(); ?>

    I left out the list of categories...it is long...so that's what I have been using, and each category page is the same.

    Thanks,
    Alice.

  • DavidM
    • DEV MAN’s Mascot

    Hiya Alice,

    Alright, so that one had me confused for a while! You're using custom MarketPress template files like mp_global_products.php to display these pages, which I should have noticed given the urls!

    And it looks like the title issue is discussed in the following thread:
    https://premium.wpmudev.org/forums/topic/marketpress-template-page-mp_global_productsphp-works-but-browsers-title-says-page-not-found

    I'm venturing to guess you can use the snippet given toward the end of the post in your functions.php file to get more customized titles there, but currently, MarketPress provides solely for the site name.

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.