OMP3: book series and categories included on the catalog page?

Hi, we are developing a theme for OMP without the sidebar.

In fact we moved the sidebar to the footer, where is sits well. One block item however is not well placed at the bottom of the page: Browse.

Browse provides two simple lists:
one with the available book series and one with the categories.

We would like to move the content of that Browse block to the top of the catalog page.

So we need some code to add some code here and there.
Some guidance is welcome.

Leave it. I solved it already. Slowly getting better at this stuff.

If you are able to post your code here, or link here to your code on Github, you will help out others with this same question!

Sorry, this took longer than expected.
In the document cataloghandler.inc.php I have added from line 68 on:

		// Provide a list of series to browse
	$seriesDao = DAORegistry::getDAO('SeriesDAO');
	$series = $seriesDao->getByPressId($press->getId());
	$templateMgr->assign('browseSeriesFactory', $series);
	
	// Provide a list of categories to browse
	$categoryDao = DAORegistry::getDAO('CategoryDAO');
	$categories = $categoryDao->getByPressId($press->getId());
	$templateMgr->assign('browseCategoryFactory', $categories);
	
	// If we're currently viewing a series or catalog, detect it
	// so that we can highlight the current selection in the
	// dropdown.
	$router = $request->getRouter();
	switch ($router->getRequestedOp($request)) {
		case 'category':
			$args = $router->getRequestedArgs($request);
			$templateMgr->assign('browseBlockSelectedCategory', reset($args));
			break;
		case 'series':
			$args = $router->getRequestedArgs($request);
			$templateMgr->assign('browseBlockSelectedSeries', reset($args));
			break;
	}

	// Display In Spotlight
	if ($press->getSetting('displayInSpotlight')) {
		// Include random spotlight items for the press home page.
		$spotlightDao = DAORegistry::getDAO('SpotlightDAO');
		$spotlights = $spotlightDao->getRandomByPressId($press->getId(), MAX_SPOTLIGHTS_VISIBLE);
		$templateMgr->assign('spotlights', $spotlights);
	}

Next I have added to the catalog.tpl from line 17 on:

<div class="categories_series"><div class="categories_series_block">
				<h1>{translate key="navigation.catalog"}</h1>
		{if $browseCategoryFactory && $browseCategoryFactory->getCount()}
				<div class="categories">
				<h3 class="subtitle">{translate key="plugins.block.browse.category"}</h3>
					{iterate from=browseCategoryFactory item=browseCategory}
						<div class="category_{$browseCategory->getId()}{if $browseCategory->getParentId()} is_sub{/if}{if $browseBlockSelectedCategory == $browseCategory->getPath()} current{/if}">
							<a href="{url router=$smarty.const.ROUTE_PAGE page="catalog" op="category" path=$browseCategory->getPath()|escape}">
								{$browseCategory->getLocalizedTitle()|escape}
							</a>
						</div>
					{/iterate}
		{/if}

		{if $browseSeriesFactory && $browseSeriesFactory->getCount()}
				<h3 class="subtitle">{translate key="plugins.block.browse.series"}</h3>
					{iterate from=browseSeriesFactory item=browseSeriesItem}
				<div class="series_{$browseSeriesItem->getId()}{if $browseBlockSelectedSeries == $browseSeriesItem->getPath() && $browseBlockSelectedSeries != ''} current{/if}">
							<a href="{url router=$smarty.const.ROUTE_PAGE page="catalog" op="series" path=$browseSeriesItem->getPath()|escape}">
								{$browseSeriesItem->getLocalizedTitle()|escape}
							</a>
						</div>
					{/iterate}
				</div>
		{/if}
		
{* Spotlights *}
	<div class="spotlights">
		{if !empty($spotlights)}
			<h3 class="subtitle">{translate key="spotlight.spotlights"}</h3>
				{include file="frontend/components/spotlights_catelog.tpl"}
		{/if}
	</div>
</div>
1 Like