Jump to content

Switch Custom Block with Sidebar Advertisement


Chris027

Recommended Posts

Posted

Hi Guys - I want my custom block to appear above the sidebar advertisements. Here is a screenshot, with arrows, of what I'd like to switch.

What are my options for switching the sidebar advertisement with a custom block? 

 

 

Screen Shot 2016-11-14 at 2.49.12 PM.png

Posted
19 hours ago, Chris027 said:

Hi Guys - I want my custom block to appear above the sidebar advertisements. Here is a screenshot, with arrows, of what I'd like to switch.

What are my options for switching the sidebar advertisement with a custom block? 

 

 

Screen Shot 2016-11-14 at 2.49.12 PM.png

You would need to edit the theme to switch those around - the sidebar is made up of Advertisements and then Blocks. You would be able to switch it to Blocks then Advertisements by editing the Core -> Front -> Global -> sidebar (there's an if/end if there that controls the position of the advertisement section.....just change it to position below the sidebar bit in there.

Other options? Use a block to display the advertisement instead...modify the advertisement to use a custom location instead. Then create a block that has the content set to {advertisement="key_of_advertisement"}

Result:

Screenshot_6.png

Posted

here you can try this you can add it any where if you can get it 2 work

 

<h3 class="ipsWidget_title ipsType_reset">YOUR TITLE</h3>
<div class="ipsPad ipsWidget_inner" style="border: 0;padding: 0;">
YOUR CODE
</div>

Posted

OK, this is what's in my Core -> Front -> Global -> Sidebar right now. I can't see where to switch the Advertisement with the Block. Any help is appreciated. 

 

 

 

{{if (isset( \IPS\Output::i()->sidebar['enabled'] ) and \IPS\Output::i()->sidebar['enabled'] ) && ( ( isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== '' ) || ( isset( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) && count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) ) || ( \IPS\Dispatcher::i()->application instanceof \IPS\Application AND \IPS\Dispatcher::i()->application->canManageWidgets() ) )}}
	<div id='ipsLayout_sidebar' class='ipsLayout_sidebar{$position} {{if !( isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== '' ) && ( !isset( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) || !count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) ) && \IPS\Dispatcher::i()->application->canManageWidgets()}}ipsLayout_sidebarUnused{{endif}}' data-controller='core.front.widgets.sidebar'>
		{{if isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== ''}}
			<aside id="elContextualTools" class='ipsClearfix' {{if isset( \IPS\Output::i()->sidebar['sticky'] )}}data-ipsSticky{{endif}}>
				{expression="\IPS\Output::i()->sidebar['contextual']" raw="true"}
			</aside>
		{{endif}}
		{{if isset(\IPS\Output::i()->sidebar['widgets']['sidebar']) and count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) and ( \IPS\core\Advertisement::loadByLocation( 'ad_sidebar' ) ) }}
			{advertisement="ad_sidebar"}
			<br><br>
		{{endif}}
		{template="widgetContainer" group="global" app="core" params="'sidebar', 'vertical'"}
	</div>
{{endif}}

 

Posted

Advertisements are...

{{if isset(\IPS\Output::i()->sidebar['widgets']['sidebar']) and count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) and ( \IPS\core\Advertisement::loadByLocation( 'ad_sidebar' ) ) }}
			{advertisement="ad_sidebar"}
			<br><br>
		{{endif}}

...above the sidebar....

{template="widgetContainer" group="global" app="core" params="'sidebar', 'vertical'"}

.....so swap them around.

 

 

 

 

Posted
4 hours ago, bern5 said:

we can have custom sidebar blocks ??

Yes, if you have IP.Pages installed.

Go to ACP > Pages > Blocks and create your own custom blocks, which can be used anywhere including the sidebar.  

 

 

Custom Blocks.JPG

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...