• First of all let me vent for a second about what is labeled in the admin as “blogroll” but referered to in code as “bookmarks”… can all that cnform to one title please??

    Now on to my question – I wanted to use one category in my blogroll entries as content for a page of nothing but links… no problem I made a template that displays all “bookmarks” for a particular category even if they are set to be invisible, I created a page from the template, I made the bookmarks invisible, I excluded that new page from the main nav’s wp_list_pages statement. and I made a hard coded reference to it in my sidebar…

    what I ended up with is fine, its a page that is hidden from the main nav, appears in the sidebar and generates a page with a list of links which are controlled by a particular category in the blogroll manager… 🙂 Life is wonderful!

    My actual question though is this: I want to keep the template generic to be used with other categories/pages with link lists. Right now I have a title on the page but it is hard coded into the template. Of course I can also put a title for the page in the new pages created from my template but I’d like to have in the template a way to get the bookmark category name dynamically to use it as the title… I cant figure it out… can anyone help?

    Geo

Viewing 5 replies - 1 through 5 (of 5 total)
  • Perhaps custom fields can be used for this?

    You could use a custom field key of say… link_cat, with the value being the link category name you want to *assign* to that Page. Then in your template before passing along the category for calling up your links, insert this statement:

    <?php
    global $post;
    $link_cat = get_post_meta($post->ID, 'link_cat', true);
    ?>

    $link_cat will now hold the link category name.

    Thread Starter geo316

    (@geo316)

    …that wont work. What I’m looking to do is dynamically get the name of the link (bookmark) category the links being displayed are assigned to…

    If I can get all the bookmarks in a category and list them via “wp_list_bookmarks” then how can I display the name of the category being listed? Some variable somewhere has to contain that name right?

    if it helps to visualize, here’s my template code:

    (“XXXXX” is where I’d like to dynamically insert the bookmark category name, category id “9” is what I’m filtering here.)

    <div id="content" class="widecolumn">
    
    <div class="pagetitle">XXXXX</a></div>
    
    <div id="customlinkpagenav">
    <ul>
      <?php wp_list_bookmarks('hide_invisible=0&show_description=1&orderby=name&category=9&&title_before=&title_after=&categorize=0&title_li='); ?>
    </ul>
    </div>
    
    </div>

    A problem for me understanding what you want is how you expect to assign a link category to wp_list_bookmarks(). Is it meant to be passed to the Page dynamically as well? If so, where is it collected from? If not, then why grab the link category name “dynamically” when you already know the category?

    You say you want it to be dynamic, but I don’t see where the information on the link category is supposed to be held to allow for it. You could base it on the Page’s title, or a custom field data set, or something altogether else, but you’ve yet to specify this.

    Thread Starter geo316

    (@geo316)

    Hmmm… I think I see what you are saying – somewhere somehow I do need to manually set the desired category to be filtered…

    …and I guess that instead of using the category id to filter wp_list_bookmarks() I can use the category name and pass it to the template (actually the page created from the template) via the post’s custom fields…

    Sound right?

    …and I guess that without creating a plug in or hacking the admin I cant dynamically show a list or drop down of link categories on the write post admin page… any ideas about that possibility?

    Thanks for helping me to think through this…

    Geo

    Sound right?

    Well yeah. It’s pretty much what I laid out in my first reply. :)

    any ideas about that possibility?

    A combination of something like this:

    http://rhymedcode.net/projects/custom-field-gui

    with customized code collecting link category names and listing them as options in a field value is a nontrivial bit of work, but certainly doable.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘show just title of a bookmark (link) category’ is closed to new replies.