How to configure DFP no to place an empty place holder if there is no ad? - banner

We have a 728X90 banner in our site. For some countries we don't have a banner to display and from some reason the DFP still holds the empty space.
How can we configure it to only occupy the space if a banner is displayed?

You need to use the collapseEmptyDivs method.
You can read more about it here: https://support.google.com/dfp_premium/answer/3072674?hl=en

Related

Magento 2 modify contact us page

can somebody explain how i can modify the contact us page. I would like to insert a custom block with google maps inside that covers the full width of the page. The rest of the page will stay with the same layout (space on ether side of the content).
Thanks,
If we are talking about the usual statics block, which can be added through the admin panel, then so:
1) create a static block with your content
Content > Block
2) create a widget and bring to the right place the static block
Content > Widgets
with such parameters as on the screen

oracle apex floating Region that is fixed in place while scrolling screen

There are 2 regions on my Oracle apex page, the top one is like a header section, which I want to keep it "floating" on the top the screen while the rest of the page scroll. (like the invoice header info always available when the user scrolls through a long transaction log.)
I have done some google search on this and someone suggested identifying the parent class(e.g. "parent_class") to the Region Header, and add the following CSS to the header of the region
.parent_class{
margin-top:0;
position:fixed;
right:0;
}
I tried but seems like not working unless I got the parent class wrong.
Can someone please give me some advice on this?
You need to use top instead of margin-top.
Here is the technique I have used in the past...
http://www.modernapex.co.uk/floatingbuttons/
You wont need the JS stuff I don't think, as that's about switching a region between fixed and static, but the technique may interest you.

Pyro Cms Flicker Gallery add On(from Arthur guy) Not showing the complete photosets on Front end

I've PyroCMS project running on my intranet, and i have used the flicker gallery from https://arthurguy.co.uk/code/pyrocms-add-on-flickr-gallery
The Back end that is admin panel showing all the photo galleries (21), but the front end of site not showing the Last two added photo galleries.
contacted the author but he might not able to provide feed Back.
Going through this issue, it might looks like the cache problem as this addon use the cached result as well, so first try to change the cache length from the admin panel settings and check the results.
If the problem remains there the look into the front end controller flicker_gallery and check in the index function.
There is code snippent like this
if (! $photosets = $this->pyrocache->get('flickr_gallery_get_photosets'))
Just remove that not ! operator from the condition and check the results on front End. Then provide your response.

How to implement banner rotator

I created RoR4 project and I want to implement banner rotation system with managment including capping, total views and expiration date. The main problem for me is to store number of views of specific banner per uniq user. So imagine this scene :
we have 3 banners and just one place(for simplicity) where I show them
user comes to website
Banner A showed first time
user clicks link
Banner B showed first time
user clicks link
Banner C showed first time
user click link
Banner A should be shown the second time
How can I know that user see banner the second time ?
Searching through the internet i found that if anybody wants to create banner rotator then mostly they use cookies...
Should I prepare cookie with values for example
[{banner_id:1, views:1}, {banner_id:2, view:3}]
and with every http request check cookie and modify its values ?
We all know that cookies can be easly removed. Is it some better way to do it ?
Please dont instruct me about reinventing the wheel. I know that OpenX and similar things exist.
Any help would be appreciate !
Yes, generally you would do this using cookies (or in Rails, using sessions which are based on cookies). Yes, cookies are easy to remove, but usually for something like banners the small number of users who will do this is usually not a problem. If it's a problem then you probably want to implement actual authentication and force users to login, and then you can store the banner viewing information in your DB.

Ajax - How to change URL by content

I'll explain:
I have a picture gallery, the first page is display.php.
Users can flip through pictures using arrows, when you click an arrow it sends an Ajax request to retrieve the next picture from the db. Now I want the URL to change according to the picture displayed.
So if the first picture is:
www.mydomain.com/display.php?picture=Paris at night
I'll flip to the next one and the URL would be
www.mydomain.com/display.php?picture=The Big Ben
How do I do this?
The trick here are uri's with an anchor fragment.
The part before '#' points to a resource on the internet, and after normally designates to a anchor on the page.
The browser does not refresh if the resource is the same but moves to the anchors position when present.
This way you can keep the convenience of browser history from a usability point of view while replacing certain parts on the page with ajax for a fast and responsive user interface.
Using a plugin like jQuery history (as suggested by others) is really easy: you decorate certain elements with a rel attribute by which the plugin takes care of the rest.
Also kinda related to this topic is something called 'hijax', and it's something I really like.
This means generating html just like you would in the old days before ajax. Then you hijack certain behavior like links and request the content with ajax, only replacing the necessary parts. This in combination with the above technique allows really SEO friendly and accessible webpages.
You can use the jQuery history plugin for example.
changing the search of the url will load the changed url.
See also: stackoverflow, javascript changing the get parameter without redirecting
Do you really want to use AJAX here?
A traditional web request would work like this...
User navigates to display.php
User clicks "next" and location is updated to "display.php?picture=Big-Ben"
Big Ben is shown to user, along with a link to "display.php?picture=Parliment"
User clicks "next" and location is updated to "display.php?picture=Parliment"
And so on.
With AJAX, you essentially replace the GET with a "behind the scenes" GET, that just replaces a portion of your page. You would do this to make things faster... for example...
User navigates to display.php
User clicks "next" and the next image location is obtained using an AJAX request
The image (and image description) is changed to the next image
What you are suggesting is that you retrieve the "next url" using AJAX and then also perform a GET on the whole page. You would be much better off sending the "next" image when you send each page and not using AJAX at all.
this best describes everything i think: http://ajaxpatterns.org/Unique_URLs

Resources