Jump to content
DevFuse Forums

Display new bloc on sidebar


Bocar

Recommended Posts

Hi. I want to put an ad on the sidebar below the first bloc

I've placed the tag but there is a problem.

The  {advertisement="PAVE"} shows but not correctly on desktop, only when you reduce your page..

My code

 

{{$adsForceSidebar = ( \IPS\Settings::i()->ads_force_sidebar AND \IPS\core\Advertisement::loadByLocation( 'ad_sidebar' ) );}}
{{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() ) || $adsForceSidebar )}}
	<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() && !$adsForceSidebar}}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 $adsForceSidebar OR ( \IPS\core\Advertisement::loadByLocation( 'ad_sidebar' ) AND ( ( isset( \IPS\Output::i()->sidebar['contextual'] ) && trim( \IPS\Output::i()->sidebar['contextual'] ) !== '' ) OR ( isset( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) && count( \IPS\Output::i()->sidebar['widgets']['sidebar'] ) ) ) )}}
			<div data-role='sidebarAd'>
				{advertisement="ad_sidebar"}
			</div>
			<br><br>
		{{endif}}
		{template="widgetContainer" group="global" app="core" params="'sidebar', 'vertical'"}
      {advertisement="PAVE"}
	</div>
{{endif}}

 

Can you help us correct this ?

ThX.

Link to comment
Share on other sites

  • Management

Is there any reason why you can't use the existing "ad_sidebar" ad location? Seems to be code already there for it.

If not, what is the html contents of your PAVE ad? It sounds like you might have a "collapse" css style in place that usually collapses when on mobile and not desktop. So not sure why yours is.

Link to comment
Share on other sites

Hi

ad_sidebar ad location does the same thing.

The content of PAVE is :

<div class="ipsResponsive_hidePhone ipsResponsive_hideTablet">
  <div id="sas_439"></div>
<script type="application/javascript">
    sas.cmd.push(function() {
        sas.call("std", {
            siteId: 4877, // 
            pageId: 30141, // Page : 1-soccers.fr/rg
            formatId: 439, // Format : IMU 300x600
            target: '' // Ciblage
        });
    });
</script>
<noscript>
    <a href="//ww62.smartadserver.com/ac?jump=1&nwid=62&siteid=4877&pgname=rg&fmtid=439&visit=m&tmstp=[timestamp]&out=nonrich" target="_blank">
        <img src="//ww62.smartadserver.com/ac?out=nonrich&nwid=62&siteid=4877&pgname=rg&fmtid=439&visit=m&tmstp=[timestamp]" border="0" alt="" />
    </a>
</noscript>
</div>

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Management
On 1/29/2018 at 8:10 AM, Mostovoi said:

I have changed the size of the sidebar to make it wider, but no changes for the banner position.

Is this up on a public site I can look at? It would be a bit easier to see it in action and I assume you've also got a custom theme that might impact things differently then the default theme would.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...