Archive for the 'gallery' Category

Gallery2 Search Template

Aug 16, 2008 in gallery

How to change gallery2 column output

# 1. Navigate to: /modules/search/
# 2. Find SearchScan.inc . This controls the number of returned searches, so our first step is to modify this file. ** Be sure to take a copy somewhere safe on your PC before modifying anything**
# 3. Find line number 113 which reads:
/* TODO: Parameterize this */
$scanSize = 3;

4. This value controls the maximum number of results. In this example we will create 12 so we change the following:

$scanSize = 12;

# As you can see we have got 12 searches BUT gallery2 has strung them into one big line, and it goes totally off the screen in one big table.
# 6. NEXT we tell Gallery2 to insert table breaks to create a nice structure. For this example we will set it to 4 items per line.
# 7. We have to change directory into: /modules/search/templates/
# 8. Find this file: SearchScan.tpl – back it up!
# 9. Open this file and find line 95 which reads:

	{assign var="searchCriteria" value=$form.searchCriteria}
	{if (sizeof($results.results) > 0)}
	  <table><tr>
	    {foreach from=$results.results item=result}
	      {assign var=itemId value=$result.itemId}

10. This is the start of the loop which controls the output so we have to add a line or two in here to control the output:

{assign var="searchCriteria" value=$form.searchCriteria}
	{assign var="childrenInColumnCount" value=0}
	{if (sizeof($results.results) > 0)}
	  <table><tr>
	    {foreach from=$results.results item=result}
             {* Move to a new row *}
	      {if ($childrenInColumnCount == 4)}
		</tr><tr>
		{assign var="childrenInColumnCount" value=0}
	      {/if}
	 {assign var=childrenInColumnCount value="`$childrenInColumnCount+1`"}
	      {assign var=itemId value=$result.itemId}

reference

External Image Block

Apr 06, 2007 in gallery

for displaying off-site images from your gallery

Use a PHP block like the one shown below to include an image block in a PHP page outside of Gallery.

(more…)

Extend gallery2 page nav

Feb 25, 2007 in gallery

In modules/core/classes/GalleryTheme.class, edit line 1573:
$windowSize = isset($params['pageWindowSize']) ? $params['pageWindowSize'] : 6;
The number here is the default number of pages to be shown.