I Just wanna change the content of my block when the page refreshes(Just like the concept in advertisement block changes on page refresh).I'm doing a drupal7 site.That block is a dynamic one (views:block) it has four fields of three text and one image field.
The block's content belongs to a content type "X".On the page refresh the block should show one of content of content type "X".
I want to change the content of the block whenever the page refresh takes place.
Could you please give me the guidance for the script?
Again I don't thank you need a script for this. I guess we can do this by setting the "Items per page" in view to 1 and and in sort criteria select "Global: Random". This should randomize the display of content in the block on every page refresh.
Related
I'm in need of a function to check content from a certain part of the site and print it on the main header.
Any idea of how can i do this? It's a radio website.
What i need to track is the content of each program and print the names on the header every half hour.
Any help is appreciated.
I wish to use Chrome devtools' "local overrides" for a test project. I wish to only change a single character on this page, and save it to my computer. On the webpage I have chosen, there is a page I wish to change. This page is only accessible via clicking a button on the previous page. Both the previous page and the page I wish to change have the exact same URL, like so:
https://stackoverflow.com/questions/ask?guided=false (page 1 with button)
https://stackoverflow.com/questions/ask?guided=false (page 2 reached from page 1)
The pages hold some similar elements that do not change, but a large portion of the page switches from one table to another.
All elements in the table are text with hyperlinks, and in regular inspect element it is trivial to find and replace the character on the second page, but within local overrides' 'Network,' and 'Page' tabs, II can only ever find reference and elements of the first page. Is what I am attempting even possible? Please excuse any ignorance on my part, I am simply trying to better understand local overrides, and how it would work here.
I want to add dynamic contents to the slides of my jquery slider. the dynamic contents are selected by user through select boxes. The problem is when I add dynamic content it is shown in the div of slider but as soon as I click on Next or Prev that content is lost:(
Please tell me how to store that information on the slider page, so that it won't get lost.
Thanks..
I do this sort of thing all the time. Put the slider on a separate page with all its logic (ie reading the the slides etc from a table). Make it entirely self contained. You can either pass some variables from your user selection or set a session variable that controls the dynamic retrieval.
In your main page call this page with JQuery, something like
$(document).ready(function() {
$('#mysliderdiv').load("whateverthepagewiththeslideriscalled");
});
You can put logic on the boxes to change the session variables. If you are using php for example in the onclick you could use AJAX to pass the selection to a php template which will change the session variable. It will of course be invisible to the user.
As the slider page is loaded by AJAX every time a page is loaded it will be correct.
Sounds a bit long winded but I have done this many times and it works fine.
I used to use Firefox3.6 but with Firefox4.0 when certain amount of popoup windows are generated, following message will appear.
Prevent this page from creating additional dialogs
According to my research, about:config page has dom.popup_maximum variable to adjust max popup limit but I cannot ask my end users to change their browser setting just because of my app.
I searched alternative coding to popup.
Many of them defines div and hide/show them with CSS using jQuery.
But I have 10 HTML pages with button that popup same page.
window.open("http://www.sample.com","samplePage");
I do not want to pre-define the contents of samplePage in every 10 pages for this reason.
Is there any alternative to popup which I do not have to pre-define in every page?
You can still do the css trick, but put an iframe in the div.
Click button then does the following:
1. Set iframe src attribute
2. Show hidden div
You can load that sample page dynamically. You either may use frames (especially <iframe>s in here) or any type of ayax, which means receiving data from the server (html, xml, json, whatever) and then showing the data in a <div>. You don't need jQuery for that.
I am developing a retail store website and am using an html page with JavaScript. I want to use iFrames. The main page (Page1) is made up of a banner, a menu on the top and an iFrame below. For clarity I will call this iFrame1. In iFrame1 I have an html page (Page2) that contains another iFrame. I will call this iFrame2.
Page 1 has a top level menu detailing departments for example curtains, cushions, clothes etc. Selecting one of these items brings up another page (Page2) with a 2nd level menu based upon the selection within the first menu and a ListView of relevant sub headings and images pulled from the database. Making a selection from the menu in Page2 will change the “Where~ clause in the Select SQL statement and bring up different items for example types of curtains, colours of cushions, sizes available etc.
What I am looking for is a way to automatically resize both iFrames depending on the number of items that are displayed in the ListView in Page2.
Im not exactly familiar with iframe's (except for all the people telling me not to use them). So might i suggest using ajax instead with div's? (please correct me if im wrong in suggesting this)
You could define a scrollbar to appear instead of trying to automatically resize an iframe. What you're describing sounds messy though, and iframes there are many reasons why not to use iframes (http://blondish.net/iframes-why-not-to-use-them/). Try divs, and dynamically including the content?