Adding list of items into any type of template

sammael

Joined: 2009-11-16
Posts: 9
Posted: Tue, 2009-11-17 21:48

Hi!

i have question:

How could I make a simple mySQL Query and insert the result into any type of Template?

for example: I have the searchmodul Template (SearchScan.tpl) and i want to insert a list of all albums into a pulldown menu. How can i insert this query? Into the .class file? And how can i call and execute it? With the .inc file?

I hope u understand my questen :/

best regards

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2009-11-17 23:54

Why not just include the album select block or AlbumTree to the sidebar then it is visible all the time nit just on the search results page?

The other option is to add the block manually to the template file of the SearchScan.tpl:
http://codex.gallery2.org/Gallery2:Themes:Reference:Blocks

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
sammael

Joined: 2009-11-16
Posts: 9
Posted: Wed, 2009-11-18 00:29

Thx Dave, but i need the list to be in a dropdown menu to select in which album the user wants to search.

Can i realise this by adding the block manually?

I tried to add

Quote:
{g->block type=albumselect.AlbumSelect}

to the SeachScan.tpl but nothing happens. Some other blocks work. Why?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2009-11-18 01:10

I bet you need to add the JS as well:

<script type="text/javascript" src="modules/albumselect/dtree.js"></script>
              {g->block type=albumselect.AlbumTree}
Quote:
list to be in a dropdown menu to select in which album the user wants to search.

this will not slect the album that the user searches in, it just provides a dropdown for navigation to the album they select.

I know of no specific modification to choose what album to search in.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
sammael

Joined: 2009-11-16
Posts: 9
Posted: Wed, 2009-11-18 01:34

So i have to write a new block for this i think.

thx dave