Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • in reply to: adding repeatable div, second attempt #4301
    giec
    Member

    Thanks Steve. Sorry for the very slow reply, but I’ve been away with no internet for a while.
    I’ll have a look at this and try to cook up something, then post back
    thanks for your help!

    in reply to: Adding a repeatable div #4097
    giec
    Member

    Ah, OK cool, I will do in a few days as I’m away now
    thanks

    in reply to: Adding a repeatable div #4093
    giec
    Member

    I would have thought the metabox was there because I’ve added a metabox folder inside the pklist folder in my theme, as per the tutorial. Aside from that, does it make sense what I’m trying to achieve with this plugin?

    in reply to: Adding a repeatable div #4091
    giec
    Member

    I think the site was down yesterday, I checked the image again and it works OK now, thanks

    in reply to: Adding a repeatable div #4084
    giec
    Member

    Thanks Steve, I tried that,but it breaks my text editor, in that the tool bar that is supposed to appear on the top of the text editor has disappeared and the text I type in it is invisible, here is a screenshot http://postimg.org/image/m7mx5hnvv/

    I hope what I said made some sense Steve, that’s how I envisaged to use the plugin, but obviously I don’t know whether it will allow me to customize the backend in the way described. I mean adding select boxes, radio buttons etc is exactly what I need, but I have to have the possibility to make them do something – mainly allow users to add content to the front end pages, a bit like drupal I presume

    in reply to: Adding a repeatable div #4082
    giec
    Member

    well, both, sorry maybe I didn’t explain things correctly.
    Basically I wanted to add, at the backend, the functionality to allow me to add HTML tags to the front end by using select boxes etc. So, say, I want to have two divs to be added to his page: I’ll use a select box (which I have added to the backend using this plugin) to allow me to add one or more divs to the text editor at the backend, and when I click “update” these divs will be added onto the page (front end).

    If you look at my screenshot here http://s1.postimg.org/qxcifziz3/wordpress_backend.png you’ll see the select boxes just below the text editor: when I’m happy with the number of divs I want to add to my page, there will be a mechanism – an “Add” button perhaps – that if pressed will add the number of specified divs to the text editor and consequently to the actual page.

    In essence I want to use this plugin to customize the back end so that an hypothetical user, who knows no HTML, will be able to rely on my customization (select boxes and whatever else) to add code to his page, allowing wordpress to act as a proper CMS.
    I hope it is clearer now, and sorry if it wasn’t before.

    in reply to: Adding a repeatable div #4078
    giec
    Member

    Ah, apologies for that. I’ve made the changes, but still nothing, in the sense that I can add and remove divs at the back end, but I can’t get the divs to appear dynamically (when I add one for example) in the text editor. Happy to zip up everything if it is easier, whatever you think it’s best.
    cheers

    in reply to: Adding a repeatable div #4071
    giec
    Member

    Hi Steve, I’ve just implemented your solution, and I do get the select box with the add/remove buttons as per screenshot http://s1.postimg.org/qxcifziz3/wordpress_backend.png but I don’t seem to be able to add any div to the editor. Here is the code:
    my-fields.php

    <?php
    /*
    Title: My Metabox
    Description: My cool new metabox
    Post Type: page
    
    */
     
    // Let's create a text box field
    piklist('field', array(
    	'type' => 'select'
    	,'field' => 'my_divs'
    	,'label' => __('Select a Div')
    	,'add_more' => true
    	,'choices' => array(
    		'div_one' => 'Div One'		
    	)
    )

    custom-div-div_one.php

    <?php
    	<div class="infoBox one"></div>
    
    ?>

    test-templ.php

    <?php /* Template Name: New Test page*/ ?>
    <?php get_header(); ?>
    <?php 
    	$my_divs = get_post_meta($post->ID, 'my_divs'); // Get the field data
    
    	foreach ($my_divs as $my_div => $name) // loop through each add_more
    	{ 
    		get_template_part('custom-div', $name); // display the template
    	}
    ?>
    <?php get_footer(); ?>

    Am I missing something, shouldn’t the plugin take care of that of do I have to write the code?
    thanks
    A

    in reply to: Adding a repeatable div #4064
    giec
    Member

    Thanks Steve, I think it makes sense yes, and thanks for the tutorial, I will read it with interest and i’ll keep implementing your solution. Thanks!

    in reply to: Adding a repeatable div #4062
    giec
    Member

    OK, so I’ve done some work implementing your code. One thing I’m not too sure about – and sorry for being a complete noob – but you know the 3 divs you said they should match the dropdown values:

    custom-div-div_one.php
    custom-div-div_two.php
    custom-div-div_three.php

    Those presumably are partial templates, aren’t they? Should they go together with my custom template in the page-template folder? More importantly, what code goes in them? Presumably <div class="infoBox"></div> but if so, I don’t need three separate partial templates because the divs inside will always be the same, I just want the users to have the possibility to choose how many they want to add if that makes sense
    thanks

    in reply to: Adding a repeatable div #4061
    giec
    Member

    Very nice of you, I’ll see how I get on. One more question of a more general nature about the plugin if I may. As you gathered from my previous question, allowing user to add functional markup without knowing any HTML from the backend, is one of the main reasons why I downloaded the plugin. I’ll also need users to be able to change things like CSS styles (using always the same method of selecting/deselecting boxes/radio buttons at the backend)and perhaphs, if possible, make some changes to jquery functionalities, like er, change the speed of animations etc. Does this plugin allow this?
    thanks

    in reply to: Adding a repeatable div #4054
    giec
    Member

    Hi steve, thanks for taking the time to write the code. I think it makes sense to an extent (the problem is also my limited understanding of PHP at this stage as I literally just started with it) in any case, I will apply the code you gave me and see how I get on with it, i’ll post back if I get seriously stuck!
    thanks again

    in reply to: Adding a repeatable div #4046
    giec
    Member

    OK I think I managed to get it to display, but how do I change the sample code to get a div with a class? I had a look at the field parameters page https://piklist.com/user-guide/docs/field-parameters/ but there is nothing about divs. Any idea?

Viewing 13 posts - 1 through 13 (of 13 total)