Link from sidebar to footer

Post Reply
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm

Wed Mar 13, 2019 7:29 pm

Hi, everyone!
I need to move links from sidebar to footer.
Two blocks. Useful Links and Categories in Two Block Footer

+++++++++++Footer+++++++++++++++
Links Categories
Link1 Music
Link2 Video
... ...
Linkn Else
User avatar
Edi
Site Admin
Posts: 1487
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Mar 13, 2019 8:11 pm

You can modify any theme to meet your requirements and use code of the plugins in the footer template.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm

Wed Mar 13, 2019 10:01 pm

I understood how to add categories:

Code: Select all

<?php foreach ($categories->db as $key=>$fields): ?>
<a href="<?php echo DOMAIN_CATEGORIES.$key; ?>"><?php echo $fields['name']; ?></a>
<?php endforeach ?>
but I still can't add useful links
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm

Thu Mar 14, 2019 12:37 pm

For Categories:

Code: Select all

<ul class="list-unstyled">	
	<?php $items = getCategories(); ?>
	<?php foreach ($items as $category): ?> 
		<li><a href="<?php echo $category->permalink(); ?>"><?php echo $category->name(); ?></a></li>
	<?php endforeach ?>
</ul>
How can I do this for the "Links"?
User avatar
Edi
Site Admin
Posts: 1487
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Thu Mar 14, 2019 12:57 pm

Why not use the code of the plugin Links? ;-)
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm

Thu Mar 14, 2019 1:19 pm

I do not understand how. Could you set an example?
User avatar
Edi
Site Admin
Posts: 1487
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Fri Mar 15, 2019 12:31 am

There is a description in the documentation:

https://docs.bludit.com/en/dev-snippets/plugins

Sorry for not posting the link before.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Artem
Ssr. Bludit
Posts: 10
Joined: Wed Mar 13, 2019 7:24 pm

Fri Mar 15, 2019 8:36 am

Thank you! Perfect!
Maybe someone will be useful:

Code: Select all

<footer>
	<!-- Categories (plugin Categories must be activated) -->
	<h5 class="text-uppercase font-weight-normal"><?php echo getPlugin('pluginCategories')->getValue('label'); ?></h5>
	<ul>	
		<?php foreach (getCategories() as $category): ?> 
			<li><a href="<?php echo $category->permalink(); ?>"><?php echo $category->name(); ?></a></li>
			<!-- Each category is an Category-Object -->
			<!--
			<li>Category name: <?php //echo $category->name(); ?></li>
			<li>Category key: <?php //echo $category->key(); ?></li>
			<li>Category description: <?php //echo $category->description(); ?></li>
			<li>Category template: <?php //echo $category->template(); ?></li>
			<li>Category link: <?php //echo $category->permalink(); ?></li>
			<li>Category number of pages: <?php //echo count($category->pages()); ?></li>
			-->	
		<?php endforeach ?>
	</ul>
	
	<!-- Useful Links (plugin Links must be activated) -->
	<h5><?php echo getPlugin('pluginLinks')->getValue('label'); ?></h5>
	<?php
		$jsondb = getPlugin('pluginLinks')->getValue('jsondb', false);
		$links = json_decode($jsondb);
	?>
	<ul>
		<?php foreach( $links as $name=>$url ): ?>
			<li><a href="<?php echo $url; ?>"><?php echo $name; ?></a></li>
		<?php endforeach ?>
	</ul>
</footer>
Post Reply