Directory Plugin Shortcode

after a couple months of trying to figure out how to integrate the v.1.x plugin into my theme (with little luck and lots of time and money), Ive backed all that up, went back to my original theme and installed the v.2.x version.

my question is in 2 parts.

first, the shortcode [dr_list_categories] does seem to work in a widget or page/post but I was wanting to add it to a specific content area of the home page, and you can see on my page that it doesnt work that way. It only shows the shortcode

http://houstonhomeandlandsource.com/
you will see it is there twice, I added it to a widget and I also added the shortcode inside the index.php to test it. ultimately I need it where it only says "[dr_list_categories]" and not in the upper widgeted area.

is there a way to get this code to work inside the php? or does one have to turn that area into a widget area before it works?

secondly, it seems we have lost a lot of options of how its laid out, In the 1.x version I had it laid out to display in multiple boxes, but it seems the only display option we have now is the list mode. Did we loose these other display options? I hope not, clearly to go in the area where I am trying to assign it (and for the reasons I originally purchased it), a simple 1 column list doesn't work.

I am VERY happy that you finally updated it to work with other themes but Im a bit disappointed that there is only a single shortcode for integration :slight_frown: I really hoped for all the display options it once had via different shortcodes. Sadly Im now 3 months behind on this website and still no further than before.

Suggestions?

Roz

  • aecnu

    Greetings Roz,

    I see the issue though I do not know the cure as of this moment. I will get hot on it with the developer to see what the problem is and thank you for supplying the URL because in this case it will be invaluable to figure out where the problem is at.

    To answer your second question, yes there is scheduled to be more enhancements to the Directory plugin as it was reported the developer is working on complete dis-integration of the Directory plugin from its formerly included theme.

    Thank you for being a WPMU Dev member and I should have some developer input for us here soon.

    Cheers, Joe :slight_smile:

  • Arnold

    @neuroticartist

    Hi, I kind of inherited this one. You mention putting the shortcode in the index,php to get it to display. How did you embed it? In a php file it should be

    echo do_shortcode('[dr_list_categories]');

    or

    <?php echo echo do_shortcode('[dr_list_categories]'); ?>

    Depending on where you're at.

    Shortcodes can't expand themselves unless they go through theContent for a page. Let me know if that was the problem.

  • neuroticartist

    sorry for the late reply on this, I was out of the state for a week.
    there is a typo in your response code, while you are correct, I didnt add it this way, I just added the shortcode, your code has echo in it twice, figuring that out and making the correct change, I was able to make this work correctly using

    <?php echo echo do_shortcode('[dr_list_categories]'); ?>

    thanks for that tip.

    Is there any news on when this new release will have additional display options? originally I had it laid out in the boxes, the list only wont work for how I have built it into the design and am on "hold" now that I cant use it that way. is there a update release date or a way I can beta test the new version or add those display options back somehow?

  • neuroticartist

    I installed this new version 2.x when it came out, so to get on the same page with you I just updated it and found those settings but selecting and saving all 3 doesnt change how the directory categories are laid out. is there new documentation somewhere that will explain those 3 options to me?

    In version 1.x there were display options and one of them had each category in a box, this option would lay them out in multiple columns and widths etc. The new 2.x version only shows the categories in a list, which would work in a sidebar but Ive designed the site around the previous version and needed it to fill a page area.

    please see the site here:
    http://houstonhomeandlandsource.com/

  • Arnold

    Ah I was refering to the fields on the actual listing.

    OK the categories are laid out like this

    <ul>
    <li><h2><a href="some.url">Category 1</a></h2>
      <a href="some.url">SubCategory of 1</a>(count)
    </li>
    <li><h2><a href="some.url">Category 2</a></h2></li>
    <li><h2><a href="some.url">Category 3</a></h2></li>
    </ul>

    First put a div around it wiht a class or id attribute so you CSS has something to differentiate it from other lists

    <div id="my_categories">
    <?php echo do_shortcode('[dr_list_categories]'); ?>
    </div>

    Now your CSS has a way to address them. This off the top of my head but it should move things around for you. Add some CSS

    #my_categories{ /* set the size of the area */
      width: 600px;
      height: 200px;
    }
    
    #my_categories li{
    float:left;
    width::25%;
    }
    
    #my_categories h2{ /* this controls the h2 tag look */
    
    }
    
    #my_categories a{  /* style the links*/
    
    }

    That should get you started. List like this have a lot of ways to be styled. They are how menu are usually layed out. You do have to learn some CSS though.

  • Arnold

    The UL and LI tags are what the short code generates.

    The CSS code I gave you would go in your Theme's CSS file, usually style.css in the them directory. Depends on the theme. Thesis for example gives you a separate custom.css just for this kind of thing.

    Some articles:

    http://codex.wordpress.org/Styling_Lists_with_CSS

    http://blog.kjodle.net/2012/02/24/styling-wordpress-posts-pages-archives-and-home-pages-by-class/

    And you should get Firebug for Firefox so you can see the structure of your pages and how the CSS affects them.

  • neuroticartist

    oh ok I see that you are telling me that where I put the short code I need to add a div around it and call it #my_categories, so in effect I am having to create all my own general styling for this, right?

    So since you inherited this, and since I have to create a display from scratch , I am assuming there will be no display options coming for the new 2.x versions and Im pretty much left to create my own? I dont mean to sound rude or off putting but before you buy this directory, the website promises the world but being that I purchased it like 5 months ago and Im STILL trying to figure it out and customize it - then after a couple months Im told to hang tight that a new version is coming that allows this to be used as a widget, now its a widget but all the other options are gone. Im a little aggravated about all the time and money Ive spent and honestly Im about ready to just ditch the entire thing. bla

    Again, is there any kind of documentation for 2.x that explains some of this customization? or anything at all about 2.x?

  • Arnold

    Well I can't give you a course in CSS.

    I made a quick example of what I sadi above and attached here as a text file. I coied the code generated by the shortcode at your site, added the div wit the id my_categories around the shortcode and added three style blocks at the top. I sent it as custom.txt so the system would accept it. download it and rename to custom.html and take a look. Spreads it out in 5 columns across the page.

  • Arnold

    Well that didn't work even though it claims to take .txt files Let's try it this way.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    
      <style type="text/css">
    
      	#my_categories {
      	  width: 800px;
    
      	}
    
      	#my_categories li{
      	  width :20%;
      	  float: left;
      	  height:100px;
      	}
    
      	#my_categories h2{
    		  font-size: 18px;
    
    		}
      </style>
    
    </head>
    <body>
    
    <div id="my_categories">
    <ul>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=animals" title="View all posts in Animals" >Animals</a> </h2>
    		<a href="http://houstonhomeandlandsource.com/?listing_category=animal-feed" title="View all posts in Animal Feed" >Animal Feed</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=house-pets" title="View all posts in House Pets" >House Pets</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=veterinarian" title="View all posts in Veterinarian" >Veterinarian</a>(0)<br />
    	</li>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=automobile" title="View all posts in Automobile" >Automobile</a> </h2>
    	</li>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=construction" title="View all posts in Construction" >Construction</a> </h2>
    		<a href="http://houstonhomeandlandsource.com/?listing_category=barns" title="View all posts in Barns" >Barns</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=building-repair" title="View all posts in Building Repair" >Building Repair</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=custom-homes" title="View all posts in Custom Homes" >Custom Homes</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=fences" title="View all posts in Fences" >Fences</a>(0)<br />
    	</li>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=landscaping" title="View all posts in Landscaping" >Landscaping</a> </h2>
    		<a href="http://houstonhomeandlandsource.com/?listing_category=land-clearing" title="View all posts in Land Clearing" >Land Clearing</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=lawn-garden" title="View all posts in Lawn & Garden" >Lawn & Garden</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=nurseries" title="View all posts in Nurseries" >Nurseries</a>(0)<br />
    	</li>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=realtors" title="View all posts in Realtors" >Realtors</a> </h2>
    	</li>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=tools" title="View all posts in Tools" >Tools</a> </h2>
    	</li>
    	<li>
    		<h2><a href="http://houstonhomeandlandsource.com/?listing_category=utilities" title="View all posts in Utilities" >Utilities</a> </h2>
    		<a href="http://houstonhomeandlandsource.com/?listing_category=electrical" title="View all posts in Electrical" >Electrical</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=plumbing" title="View all posts in Plumbing" >Plumbing</a>(0)<br />
    		<a href="http://houstonhomeandlandsource.com/?listing_category=water-waste-water" title="View all posts in Water & Waste Water" >Water & Waste Water</a>(0)<br />
    	</li>
    </ul>        <!-- Added Dirfectory Plugin Shortcode  -->
    </div>
    
    </body>
    </html>
  • neuroticartist

    Thanks, I wasnt asking for a course, nor for you to do it for me, I did say I knew how to use CSS but I appreciate that you want to help. Im only trying to clarify what you are telling me and asking if creating a my_categories in my theme css will conflict with something in the directory css. while I appreciate your help, you really arent answering my specific questions only assuming in a general way what I might want to do. thios doesnt answer my specific questions.

    I will take a look at this, thanks for it, since I can only now assume that there will be no additions of the display options that were in version 1.x because you wont answer that or my question about documentation (so I dont have to keep asking for help) I will give this a try, if it doesnt work I will just ditch the whole thing and look for something else.

    I appreciate your help

    Roz

  • Arnold

    The old theme is included if that's what you're looking for. In the Theme directory of the plugin there is a 'default' directory. Move that whole directory to your 'wp-content/themes' directory and activate it.

    As I understand it the old version depended on this theme to even function. People wanted to use their own themes so the move has been to break it out into a plugin that can be used with any theme. Don't think it's there yet but that's why I'm working on it.

  • neuroticartist

    Yes for the most part this is resolved, although I would consider this more of a "quick fix" (which I easily admit is better than no fix).

    ultimately Id like to see some of the display options that were available in V.1.x as adding the DIV around the shortcode only works where I put the shortcode, when you click on one of the categories and it goes to a new page, were back to the basic layout, as opposed to selecting a display option kept that display fluid on all pages.

    We can consider this post resolved though, Im sure I will be posting more as I get deeper into integrating this :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.