Making a foolproof content page


#1

So I need to make a page for a client site that needs to have several product pictures with a description beside. This needs to be able to act responsive so on small screens the image will be above it's description.
I could do this using bootstrap rows and columns. But client will need to edit and add to the page. Can't have him dealing with all that stuff. So ideally we need to have the code hidden and then have client just deal with blocks. Could have a block per product, or all on one block.
Any ideas on this?
Thanks :slight_smile:


#2

Maybe code this page and then each product is a Block?


#3

Hi, yes thats what I have done.
https://www.finelinelighting.online/lighting/control

Works well and I have some pages in two columns and some inthree.
The problem comes when they want to add a product. Then there is no option but to dive into code.
A simple catalog system would be a great addition to Pulse.
Cheers


#4

I've done this in the past with a simple plugin to loop through all of the blocks in a given folder and output them to the page.

From memory here's a quick sample that should give you an idea of how this works;
<?php
$blocksdir = $tag_var1;
$files = glob("content/blocks/".$blocksdir . '/*.txt');
for ($i=0; $i < count($files); $i++){
echo('<div>');
include($files[$i]);
echo('</div>');
}
?>

Save this as allblocks.php in the inc/tags directory and call it using;

{{allblocks:quotes}}

Quotes is the name of the folder in your blocks directory to display.


#5

Thats great Tim, thanks very much. I will have a play with that and see if I can use it.
Cheers


closed #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.