Sections as links.

sev / 2008-10-08 15:03:31   

Is it possible to have sections as links?

So for example, if I clicked on a section, it would take me to a section specific page with the relevant exhibitions expanded below it.

Vaska A / 2008-10-08 15:07:33   

Not really...but the new version has this.

sev / 2008-10-08 15:22:28   

Thanks for the swift response, Vaska.

So when would this glorious new version be arriving?

Vaska A / 2008-10-08 15:24:58   

I never answer this question any more...that's the best answer I can come up with these days.

sev / 2008-10-08 15:25:44   

Very well. I will keep my eyes peeled for the new version ;).

AirplaneNoise / 2008-10-08 16:13:16   

While we wait for the new version, Here's a quick Section Tree Plugin I made to solve this issue. It's totally not finished, but that should give you an idea.
Then you can call this particular plugin from a /root page, ie :



click to expand

  1. // error_reporting(E_ALL);
  2. // ini_set("display_errors", 1);
/*
    * Section Tree (Thumbs, Title, Date)
    * Shows all sections within a section, to be called from a [Root]/ Page
    *
    * USAGE:
    *
    *
    * Plugin
    *
    * @version 0.1
    * @author Raad
*/

// pagination function not implemented, but forward thinking...
function kr_section_tree($section, $limit = 20, $percolumn = 5)
    {

// haven't quite figured out the DynamicCSS thing used throughout, need some more time. for now :

        $section_tree_css = "
        #content #sections_container { margin:0px auto; max-width:800px; }
        #sections_container li { margin:5px; list-style-type:none; padding:8px; display:inline; float:left; font-weight:bold; font-size:10px; font-family:Arial, Helvetica, Sans Serif; }
        #sections_container li .item_title { display:block; margin-bottom:5px;}
        #sections_container li img { width:125px; height:125px; }
        ";

        // call mysql toolset
        $OBJ =& get_instance();

        // summon global variables
        global $rs;

        // count total number of items in current section (ie: 'ideas') [ ... to generate pagination ? ]
        $q = $OBJ->db->fetchArray("SELECT count(o.title) AS SectionItems
        FROM ".PX."_objects o, ".PX."_sections s
        WHERE lower(s.section) = '".$section."' and s.secid = o.section_id");        

        // extract total number of items ...
        foreach ($q as $count)
            $totalItems = $count['SectionItems'];
        
        // PAGINATE (but not yet): starting page... 1
        // $page = 1;
        // $totalPages = ceil($totalItems / $limit);
                
        // make sure user entered a section        
        if ($section == '') { print('You did not specify a section.'); return; }

        $pages = $OBJ->db->fetchArray("SELECT o.title , o.url, m.*
            FROM ".PX."objects o, ".PX."sections s, ".PX."media m
            WHERE lower(s.section) = '".$section."' and s.secid = o.section_id
            AND m.media_ref_id = o.id
            AND m.media_obj_type = 'exhibit'
            GROUP BY o.id
            ORDER BY ord ASC
            LIMIT 0,$limit");        

// debugging : // print('
QUERY:'.$OBJ->db->theQuery.'
');                  // return blank if no items in section (unlikely, but good practice)         if (!$pages) return;          // more debugging : // print_r($pages);                          // define blank link and thumbnail (reset for looping)         $item_link = '';         $item_thumb = '';         // create thumb + title for each item
        
        $i = 0;
        
        $item_link = $section_tree_css."";

        foreach ($pages as $item){

        $item_title = "$item[title]";
        $item_thumb = "\n";
        $item_url = BASEURL . ndxz_rewriter($item['url']);
        $item_link .= "
  • \n
                            $item_title\n
                            $item_thumb\n
                            

                        
  • \n";

            }

            $item_link .= "";
            
    // PAGINATE (again, not yet): Create Navigation Links
    // $item_link .= "Previous | Next Page $page of $totalPages";
        
            // silly bug where text processing add paragraph tags about (Vaska)
            $item_link = preg_replace(array('/^

    /i', '/$/i'), array('', ''), trim($item_link));

            return $item_link;
        }

    AirplaneNoise / 2008-10-08 16:15:11   

    ouch. that's totally messed up. Vaska, please delete above post (haven't figured out how to do that).

    here :

    While we wait for the new version, Here's a quick Section Tree Plugin I made to solve this issue. It's totally not finished, but that should give you an idea.
    Then you can call this particular plugin from a /root page, ie :


    click to expand screenshot

    1. // had to remove entire header or forum won't take it

    // error_reporting(E_ALL);
    // ini_set("display_errors", 1);

    // pagination function not implemented, but forward thinking...
    function kr_section_tree($section, $limit = 20, $percolumn = 5)
        {

    // haven't quite figured out the DynamicCSS thing used throughout, need some more time. for now :

            $section_tree_css = "
            #content #sections_container { margin:0px auto; max-width:800px; }
            #sections_container li { margin:5px; list-style-type:none; padding:8px; display:inline; float:left; font-weight:bold; font-size:10px; font-family:Arial, Helvetica, Sans Serif; }
            #sections_container li .item_title { display:block; margin-bottom:5px;}
            #sections_container li img { width:125px; height:125px; }
            ";

            // call mysql toolset
            $OBJ =& get_instance();

            // summon global variables
            global $rs;

            // count total number of items in current section (ie: 'ideas') [ ... to generate pagination ? ]
            $q = $OBJ->db->fetchArray("SELECT count(o.title) AS SectionItems
            FROM ".PX."_objects o, ".PX."_sections s
            WHERE lower(s.section) = '".$section."' and s.secid = o.section_id");        

            // extract total number of items ...
            foreach ($q as $count)
                $totalItems = $count['SectionItems'];
            
            // PAGINATE (but not yet): starting page... 1
            // $page = 1;
            // $totalPages = ceil($totalItems / $limit);
                    
            // make sure user entered a section        
            if ($section == '') { print('You did not specify a section.'); return; }

            $pages = $OBJ->db->fetchArray("SELECT o.title , o.url, m.*
                FROM ".PX."objects o, ".PX."sections s, ".PX."media m
                WHERE lower(s.section) = '".$section."' and s.secid = o.section_id
                AND m.media_ref_id = o.id
                AND m.media_obj_type = 'exhibit'
                GROUP BY o.id
                ORDER BY ord ASC
                LIMIT 0,$limit");        

    // debugging : // print('
    QUERY:'.$OBJ->db->theQuery.'
    ');                  // return blank if no items in section (unlikely, but good practice)         if (!$pages) return;          // more debugging : // print_r($pages);                          // define blank link and thumbnail (reset for looping)         $item_link = '';         $item_thumb = '';         // create thumb + title for each item
            
            $i = 0;
            
            $item_link = $section_tree_css."";

            foreach ($pages as $item){

            $item_title = "$item[title]";
            $item_thumb = "\n";
            $item_url = BASEURL . ndxz_rewriter($item['url']);
            $item_link .= "
  • \n
                            $item_title\n
                            $item_thumb\n
                            

                        
  • \n";

            }

            $item_link .= "";
            
    // PAGINATE (again, not yet): Create Navigation Links
    // $item_link .= "Previous | Next Page $page of $totalPages";
        
            // silly bug where text processing add paragraph tags about (Vaska)
            $item_link = preg_replace(array('/^

    /i', '/$/i'), array('', ''), trim($item_link));

            return $item_link;
        }


    AirplaneNoise / 2008-10-08 16:17:09   

    whoa. hmm. well, i am guessing Vaska will remove these posts as they look messy.
    if anyone wants that code, let me know.

    AirplaneNoise / 2008-10-08 16:17:51   

    see it sort of working here : http://fuzzmagic.com/fuzzy/ideas/

    Vaska A / 2008-10-08 16:22:45   

    Looks good...just make a zip file so people can download it.

    Yeah...soon enough we'll have an official facility here for these things...then I'm going to sleep for a couple of years.

    sev / 2008-10-08 16:43:20   

    This looks really interesting, is it possible to download this?

    purf / 2008-10-08 20:20:11   

    But it should be noted (whatever comes soon;) that you can do this right now. Sort of. Just requires writing (copy/pasting) links manually. A bit of work for something like fuzzmagic.com with nicely lined up images, but if you can live with text alone for the selection page , it's quick'n'easy.

    AirplaneNoise / 2008-10-08 21:58:38   

    gimme a couple of days. making expandable year sections, since years are so intricately built into the exhbit backend.

    sev / 2008-10-09 11:51:28   

    Nice one ;)

    Vaska A / 2008-10-10 20:05:11   

    "intricately"

    ?

    guinox / 2009-06-19 18:17:03   

    Hi, i'm new in the forum...and using indexhibit as well. Thank you very much Vaska, it's amazing!

    AirplaneNoise...if i would like to use your fantastic Section Tree Plugin what i have to do? can you send me it by zip file? I can't understand if the ones you posted here run...

    mstemmelen / 2010-05-05 20:26:12   

    Hi everyone, is it possible at all to have external links in the left handbar under the INFO section for example? If anyone knows how to do this, I would be greatful!

    mstemmelen / 2010-05-06 00:02:35   

    when you would click on that link you would see the actual page but within your site (if that makes any sense)

    mstemmelen / 2010-05-11 23:40:46   

    i guess it don't make sense :P

    Vaska A / 2010-05-11 23:50:16   

    Yes, you could append or prepend your 'index' by creating the links in html and placing them in the Pre or Post Nav areas (Exhibits > Settings).

    dann02 / 2010-05-23 22:25:55   

    Hi,
    Alternately, is there any way to style the ABOUT link/exhibition name (inline or with my css) in the main nav area to color it black (to mimic my section headings) so that it looks like a heading but acts like an exhibition page link? My other links are all grey and my section headings are black.
    Thought this could possibly work but tried lots of combinations and nothing achieved the results.
    Site in progress:
    home

    bureau44 / 2010-08-14 16:26:16   

    >dann02
    So it looks you have never managed that since...
    Anyone has got ideas?

    Can I specify "a:link" color for "li.section-title" exclusively, not for the whole menu? (Sorry for a probably stupid question)

    This thread has been closed, thank you.