Creating a dynamic image in a page through form submission from the previous page - Drupal 7 - drupal

I have a form with a textarea and a submit button in one page
which asks the user to input/paste the url of any image in the textarea
Form link:
https://m.ak.fbcdn.net/sphotos-d.ak/hphotos-ak-frc1/t1.0-9/1538781_610742105669484_767973390_n.jpg
and after the user hits submit
it should redirect it to the next page and create a dynamic image preview in the next page with the entered url in the submitted form from the previous page
Image Page:
https://m.ak.fbcdn.net/sphotos-b.ak/hphotos-ak-prn2/t1.0-9/10157400_610742102336151_950503816_n.jpg
I can't figure out how to catch the image url in the next page and create a preview. Kindly help. Please accept my gratitude in advance.

Useing Javascript you can show image preview on same page.
TO show preview after form submit try to access '$form_state' or override node.tpl.php for particular content type and get text area value using node_load function and add it to IMG tag.
Cheers!!!

Once submited, you should be able to get the submited image from the "$form_state" array. You then put it in the "src" attribute of a html image tag.

Related

Redactor - got to custom URL on submit

I have page with multiple forms, which are hidden based on what link is active. One of these forms is using redactor and I want to send the user back to this page with the redactor form open on submit. By default the page refreshes on submit and it shows the default form for that page. I couldn't find anything about this in the docs. If anyone knows how to accomplish this please let me know. Thanks
To solve this you need to use window.location.hash with this you can send a hash variable to the URL when you click on the link to get to your form.
The urlHash works as follows:
var UrlHashVal = window.location.hash.substr(1); //get the hash value and store as a var
$('form').hide(); //hide all forms by default
$('form#' + UrlHashVal).show(); //show the form whose id matches the hash value
What this does is enable you to send a link to someone, like http://ucanstayatthe.ym.ca#myForm and it will open that page with form#myForm on display.
Now all we have to do is enable this urlHash to work within the page as well. On the page we show/hide the forms based on links. All we need to do is write the formID to the URL from the link. To do this simply add the fromID to your href eg. "#myForm". Now when you click that link it will display #myform at the end of the windowURL.
This solves all of the problems because now when the page refreshes on the Redactor submit, it will reload the URL including the hashValue that you have written to it. SO instead of reloading http://ucanstayatthe.ym.ca it will reload http://ucanstayatthe.ym.ca#myForm which in turn will show the correct from.
Bingo

Joomla. How to make button "Click to see more" on bottom of page

In Joomla page I have big content and I want to make not pages like 1,2,3...etc., but like in Facebook scroll down till you see button "Click to see more" and without refresh It add some data to bottom of page.
I don't know how to make It, maybe here are any extensions? Or any scripts? So hard to make It?
Thank you for answers.
To do it the ajax way, i.e. only loading content when you intend to show it, you will need to write a custom jQuery function that onload:
finds the "next page" button and store the url into a variable (this will contain the whole url followed by &pagenumber=2 or /page/2 or something similar).
remove its handler and replace it with a custom ajax call:
jQuery.get with the url you just stored adding &format=raw (this will return the content of the next page, without the rest of the template, and without any scripts and css - which you have already loaded)
on success remove the "next page" button you modified,
then insert in its place the html received from the ajax call,
repeat from n.1 until there is no "next page" button
After reading your query i come to know that you have a large content in your joomla article. Once the page loads you want to show some part of content n later part shows once clicked on see more button. If i'm correct then write script inside your article add div tags into your content. Apply display none property to the content of div which you want to show on click. Using JQuery or Js you can show the hidden part once clicked on button.

Send e-mail with a link to another page

I already know how to send either a plane text or html e-mail from an aspx page. My worry is how to create a link to another page within the same application in the e-mail body.
For instance, If a user clicks a Save button in page1.aspx, an e-mail should be sent to someone with a link to page2.aspx as part of the body of the e-mail.
Any help will be greately appreciated.
In the body of the email you can add an anchor tag. The href attribute of the anchor tag will point to the URL where you want to redirect the user. The inner text will be the text which the user sees. If you want the link to open the target in another tab, use the target attribute, like this:
Lick here to continue...
If you know how to send html e-mail, why don't you put something like that in the body:
Link to page2

Drupal How to change access denied / login page for one protected page

I have one page ( a view page ) where I need the user to be logged-in in order to see it. But the default login page seems overly harsh and would want to a friendlier page in page stating the need to sign up to see this portion of the website.
My quick thought was the create a module that put a hook in for this particular page of the site. But I am not sure that this is the best way.
If by 'friendlier' page you mean some text stating need to "sign up to see this portion of the website", it would be better to
either
use hook_form_alter to add a markup field for text
http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#markup
or
simply create a block and set its visibility to [show only on following pages] : "user/login"

Get URL of link clicked inside frame/object

So, I have a page (page1.html) and then I have an iframe or object serving up some other page (page2.html) within that page... What I want/need is when the user clicks a link inside the iframe (page2.html) i need a way for page1.html to recognize that the iframe href has changed because the link is loaded into the iframe.
There is no onload event for the object/iframe element so i can't figure out when the user has clicked a link inside the IFRAME (page2.html)...
You have very little control over what happens in an iFrame. Essentially, once you load it, you have no power over it, and you can't see what happens in it. (You can still tell it to load something else.) If you want that sort of control, you should really be using AJAX, i.e. you should be loading new content into the document object model dynamically.
right click on the link and then click open in a new tab / new window, this will open the webpage in a new tab , then copy the url from the address bar of the browser.

Resources