• I need help with something here that I’m not sure is even possible in WP?

    I’ve created a main product page (not post) that displays thumbnails of many product images. When you click on any of these images I need to go to a new page that then shows:

    1.the title of the product
    2.the larger image
    3.download pdf button (each product has a different pdf)
    4.the following form fields:
    title of the product (transparent to the user, added automaticallly)
    *Name
    *Email
    *Phone
    *Postcode
    Comments/Questions
    Submit

    I know I could easily do all this with a new page for each product – but there are hundreds of products and it would take ages. What I want to do is have the page displaying all the thumnails then when you click on one of those it dynamically populates ONE page with all the required info passed by the URL (I guess??). Please note I do not need text descriptions of the product – just the title, larger image, download pdf and small form.

    Could someone please give me some advice on how to tackle this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • What you are asking is perfectly possible and very easy for an experienced WordPress-wrangler. However, it is far too complicated to explain in any detail in a simple forum post.

    But, to summarise, what you need to do is:

    1. Create a Custom Post Type for your products (one type, perhaps called Products, will do) (install a plugin to do this)
    2. Create a Products post for each of your products, with Custom Fields to hold (1) the link to the product image and (2) the link to the PDF.
    3. Take your theme’s pages.php file and rename it to pages-products.php
    4. Edit The Loop to pull in only the Products posts (eg. query("post_type=products&post_status=publish"))
    5. Call in the Custom Fields using (eg) <?php echo get_post_meta($post->ID, "productimage", true); ?>

    I have tried to keep this to general principles, but as you can see it was starting to get very specific. If you are not experienced in WordPress it might be worth you finding someone who is.

    Hope that points you in the right direction.

    Best of luck

    Peter

    Thread Starter netstyledesigns

    (@netstyledesigns)

    Appologies for the delayed response Peter.

    You’ve explained it well and although I’m by no means a WP coding expert I get the logic of this. One thing I didnt want to do was create imdividual product posts for each of the products, otherwise I may as well just create a new page for each product. I was more after uploading all the individual products and corresponding pdf brochures to a directory and then on each brands product gallery page (there would be 4 brands, so 4 separate pages displaying about 20 product images on each brand page) when you click on the actual product image variables for the products pdf, title and large image are passed to a simple template page that populates based on the product selected, matching it to the filenames of the pdfs/images already uploaded.

    Hi

    I see what you’re thinking, but the problem with your approach is how do you tell WordPress about your products and which brands they are associated with?

    The reason why I suggested individual posts for each product is that you can easily use tags or categories to do this. If you really fancy getting your hands dirty you could even go as far as using custom taxonomies.

    Of course, you could always look at using a plug-in like wp-ecommerce. It is a fully-functioned e-commerce shopping system, but you can apparently turn off the shopping cart and just use it as a gallery. You’d still have to make a post for each product, but it will handle all of the heavy lifting for you.

    Hope that helps

    Peter

    Thread Starter netstyledesigns

    (@netstyledesigns)

    Thanks for the advice Peter. Funnily enough I’m already using wp-ecommerce (sans shopping cart) for one section of this very site we are talking about. It may just be easier to add each product to the wp-ecommerce system after all. I guess doing it that way would give me flexibility of upgrading the individual product pages down the track if need be.

    Thankd again!
    Simon

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dynamically populating a single page. Is this posssible in WP?’ is closed to new replies.