Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

A simple way to add any content on any place on template Rate Topic   * * * * * 1 votes

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 09:26 AM #1

Hi all,
For some time i'm using this trick and i will like to share with you all.
The way of doing this is simple:
  • create a wrapper under skins/[SKIN_NAME]/customer/blocks/wrappers and name it capture.tpl with content
    #v3.x
    {if $block.user_class}{capture name=$block.user_class}{$content|unescape}{/capture}{/if}
    #v4.x
    {if $block.user_class}{capture name=$block.user_class}{$content nofilter}{/capture}{/if}
  • add the block, any type, on admin part under Design/Blocks, choose the position where you wish to appear and you need to select Wrapper and add user class
    Posted Image
  • Now to add the block content on the template just add the code
    v3.x
    {$smarty.capture.footer_right}

    v4.x
    {$smarty.capture.footer_right nofilter}
    *footer_right is the user class and you cand add anything but without spaces, one word.


I hope that helps,

Vali

Edited by Vali, 01 March 2014 - 11:17 AM.


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 15 January 2013 - 11:55 AM #2

What is the purpose of this? It doesn't appear to be any different to Design>Blocks>Default>Add Block (to any grid)>Create New Block. Create the block, then on any other page or area, Add Block>Use Existing Block, select the previously created block, which inherits the content and styling of the previously created block. Unless I've got the jist of your post completely wrong, of course...?
Hire StellarBytes for CS-Cart Design & Development Services

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 12:29 PM #3

What is the purpose of this? It doesn't appear to be any different to Design>Blocks>Default>Add Block (to any grid)>Create New Block. Create the block, then on any other page or area, Add Block>Use Existing Block, select the previously created block, which inherits the content and styling of the previously created block. Unless I've got the jist of your post completely wrong, of course...?


Ok, i am wrong in you opinion.
But what is you solution for this kind of design?
Posted Image

* Why not try? block is the purpose of this post ;)

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 15 January 2013 - 01:07 PM #4

How are you generating the data to be displayed in your 'Why not try' block? There are built-in Product block types which can achieve similar already.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 01:56 PM #5

There are product blocks but you cannot put him in that position ;) using Design/Blocks
Posted Image

* this is a mix, backend/front end, i hope you understand

PS:you a programmer?

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 15 January 2013 - 02:17 PM #6

You don't need to do that, the blocks are very flexible. All you would have to do is rearrange (or should I say recreate) the Grids and (move) the blocks into the appropriate grid. If and when CS-Cart allow the Grids to be moved, the design capabilities will be virtually limitless, you could change your entire site layout in just a few minutes.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 02:28 PM #7

Can you give an example?
a print screen of an backend & frontend with your solution?

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 15 January 2013 - 03:04 PM #8

Simple. Change the Grid Width of the grid containing 'Main Content'. Create a new grid within the same parent grid, add Products block. Done.

Attached Files


Hire StellarBytes for CS-Cart Design & Development Services

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 03:24 PM #9

Please make a print screen of the frontpage but with product tabs also, and you will see what i have in mind when i did this post, product tabs don't have a fullwidth ;), they are limited to grid_12

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 15 January 2013 - 03:43 PM #10

Stellar,

While I'd agree that you could almost do that with the standard block system, how would you do it and keep the tab content wrapping on the bottom? Normally that right grid would extend down and the tab content wouldn't wrap.

This is a pretty cool idea. While I think that the standard blocks would handle most things, this would be a neat way to add content that could be easily edited by the admin to anywhere on the page without having to mess with the grids and blocks.

Thanks,

Brandon

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 04:08 PM #11

Thanks Brandon,

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 15 January 2013 - 04:13 PM #12

Please make a print screen of the frontpage but with product tabs also, and you will see what i have in mind when i did this post, product tabs don't have a fullwidth ;), they are limited to grid_12

They aren't always limited to grid 12, they're limited to whatever Grid width you specify. Grid 12 was used in the screenshots I uploaded if that's what you mean. Product tabs also wrap, therefore if you have a fixed width of 600px but your tabs take up 700px, the extra tab wraps.

So, now I see it - what your hack does is allows you to place a Block effectively inside the products 'Main Content' block.

Good idea, I like it, it's a useful feature for some but I like to keep things as simple as possible to prevent headaches during upgrades. Not that I should think this will cause any problems, anyway.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 15 January 2013 - 07:30 PM #13

I love custom design and i must confess, i never did a update :D, and i think i will not do it in the near future,
is better to start fresh

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 16 January 2013 - 08:42 AM #14

Wow, I sure can't seem to figure this out and I just don't know what I'm doing wrong.

1.) Created a file in skins/my_skin/customer/blocks/wrappers called capture.tpl In there I put:

{if $block.user_class}{capture name=$block.user_class}{$content|unescape}{/capture}{/if}

2.) I created a block to hold sample products and made it like:

Attached File  sample_products.JPG   25.74KB   213 downloads

3.) I want this to be in my product details page below my add to cart button, but above my tabs. So in view_main_info.override.tpl below:

{assign var="form_close" value="form_close_`$obj_id`"}
            {$smarty.capture.$form_close}

I added:

{$smarty.capture.sample_products}

But nothing is showing up. I've tried moving the last bit all around, but still nothing, no matter where I put it.

Any ideas?

Thanks,

Brandon

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 16 January 2013 - 09:51 AM #15

Block Sample products must be above of maincontent, please attach a print screen with the admin/blocks/products, and
sample_products without any spaces left or right

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 16 January 2013 - 07:16 PM #16

Thank you for that. That is probably a very good point to make since it made all the difference. I now have my sample product where I want it:

Attached File  sample.JPG   17.12KB   241 downloads

Pretty cool.

Brandon

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 16 January 2013 - 07:20 PM #17

I am glad that can be on your help :) , if you wish you can PM me to ask something else, but is not time to add them all :(

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 21 January 2013 - 11:44 AM #18

Could I use this to add block showing the content of product FEATURES along side the product instead of in the tab below the product ?

Looks a nice bit of info.
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.

 
  • Hungryweb
  • Senior Member
  • Authorized Reseller
  • Join Date: 10-Feb 12
  • 1199 posts

Posted 21 January 2013 - 12:24 PM #19

Could I use this to add block showing the content of product FEATURES along side the product instead of in the tab below the product ?

Looks a nice bit of info.

You cannot use my trick to make this change because product FEATURES is not a stand alone block, if you wish you can PM me and i will help you with this request

 
  • kickoff3pm
  • Senior Member
  • Members
  • Join Date: 18-Aug 10
  • 682 posts

Posted 21 January 2013 - 12:57 PM #20

PM sent V
http://matchdaymemories.com - Football Memorabilia Via Cs-Cart V3
http://www.outadwords.com - Free Marketing For You Site.
http://www.alternativestoebay.com - Join The Free Ecommerce Community.