Drop-down tag list?

Jan 20, 2006 16:41

I've been trying to incorporate xtomxfallsx's drop-down tags list tutorial for Component into my layout myself to no avail. I haven't see this tutorial in this community either, so I was wondering if anyone knows how to make a drop-down list for tags in the sidebar. Help please?

PS: my layout is customized based on dooped's code & I'm using the updated version of ( Read more... )

sidebar, tags

Leave a comment

xtomxfallsx January 21 2006, 02:54:26 UTC
Alright, put this somewhere in your theme layer before print_sidebar()
function print_sidebar_tags() {
var string tagdd_header = "Tags In This Journal"; # set the component header text, you can change this to whatever you want
var string tagdd_button = "Go"; # button text, change it to whatever you want
var bool tagdd_blank = true; # set to true to create a blank option at top the list, or false not to
# No need to change anything below this line (unless you know what you are doing!)

var Page p = get_page();
var string tagdd_base_url = $p.journal->base_url();
var string tagdd_content = "";
var string tagdd_options = "";
var TagDetail[] tagdd_tags = $p->visible_tag_list();

foreach var TagDetail tagdd_tag ($tagdd_tags) {
$tagdd_options = $tagdd_options + """$tagdd_tag.name\n""";
}
$tagdd_content = $tagdd_content + """
""";

print_sidebar_box($tagdd_header, $tagdd_content, "");

}Then, inside print_sidebar(), toward the end where you determine the sidebar order, put in print_sidebar_tags(); wherever you want it to show in the sidebar.

Then just make sure you've got set show_tags = true; in your user layer. This will only work with the new version of Flexisquares, not the original.

You can use CSS in print_custom_head() to style the dropdown (#tagsdd_select) and the button (#tagsdd_input).

Reply

kindlin January 21 2006, 04:53:39 UTC
That worked fabulously! Thank you. You're awesome. :)

Reply

(The comment has been removed)

kindlin February 11 2006, 21:28:11 UTC
I can't really help you except to say that the code xtomxfallsx provided for me is for the new Flexible Squares version that I'm using for my layout. Maybe you should make a new post with your layout because xtomxfallsx might not check this thread anymore. Just a thought.

Reply


Leave a comment

Up