I want to show a message to any anonymous user who try accessing a page, something on the lines of "login to view page" with a link to log in.
By searching, I am only getting to hide completely a page from anonymous users, but I want the page the title, or the link to the page visible; when users clicks on it, it displays an error message similar to "Please login to view this page."
I want the same for the attachments: Users can see the attached file, but when they try to download it, the error message "Please login to view this page." should be shown.
You can simly edit your theme code where you output the page, for example in node.tpl.php
you can add:
global $user;
if($user->uid){
// code for the logged user output the content
}
else{
print '<div class="yourstyle">custom message</div>';
}
Related
I need to add a paragraph of text near the top of the user profile page found at /user, this is page you are initially taken to after login.
I'm not fluent with Drupal, and I can't find any answers online.
Could any advise how I can add text to the user profile page?
you can also add a block to the "content area" to be shown below the user profile (restricted to user/* pages). In the block you an use short PHP snippets.
In a custom Drupal module you could use hook_form_FORM_ID_alter(), this will let you change the user profile form, where you could attach a div element that will hold the paragraph text you wish to insert to the page. You will also give weight to your div, so that it is displayed on top of the form.
Here is a code snippet:
function custommodulename_form_user_profile_form_alter() {
$description_html = '<div>Lorem ipsum...</div>';
$form['description'] = array(
'#markup' => $description_html,
'#weight' => -10,
);
}
I am facing the below error in my salesforce.org.
Operation: Deleting Selected Metadata
Timestamp: Wed, 29 Mar 2017 19:47:33
Result: [OPERATION FAILED]: MyFirstVFPage: The page you have tried to delete is currently being referenced by a page, custom link, button, web tab, dashboard, SoftPhone layout or custom sidebar component. Please delete the reference before deleting the page.
I am not sure whats going wrong and where to check it ?
The message says that your Visualforce page is referenced from a button, page layout, etc. You cannot delete a page if it is used anywhere.
To find out what refers to your page, go to Setup/Build/Develop/Visualforce Pages and click on the field label for your page (MyFirstVFPage). At the top of the detail page, click the button "Where is this used?". This will display a list of all places that refer to your page.
You will need to remove the Visualforce page from anything in the list.
I am trying to set a variable to set a variable to null whenever a user clicks the back button after signing in. So I am doing this but it is not working as the variable still shows on that Page which is the signin page
var currentUserNow = localStorage.getItem("username")
alert(currentUserNow);
localStorage.removeItem("userDetail");
localStorage.removeItem("username");
$urlRouterProvider.otherwise('/sign-in');
Now I want to ask is there anyhow I can tell that the user has clicked the back button to a particular page and set that variable to null
if you are trying to disable the back button in login page.
then try in login.html
<ion-content hide-back-button="true">
Unable to click on button after entering the email address.
driver = new ChromeDriver();
driver.get("http://in.rediff.com/");
driver.findElement(By.xpath(".//*[#id='homewrapper']/div[5]/a[3]/div/u")).click();
driver.findElement(By.xpath(".//*[#id='wrapper']/div[2]/ul/li[2]/a")).click();
driver.findElement(By.xpath(".//*[#id='useremail']")).sendKeys("xyz");
driver.findElement(By.xpath(".//*[#id='emailsubmit']")).click();
I am supposed to see the password input box after the submit button click. For somereason I am not able to see this. Am I doing anything wrong? Not getting any errors after this line.
System.out.println("Finish");
This line is executed as well.
Your code is clicking on the Submit button perfectly.
As per the rediff functionality, if "xyz"(username) you are entering doesnt exist, then it will redirect to Login form.
So the reason you are not getting password object. Try with any existing user account(username).
When a form or an add-button returns to a page, it throws an error or shows wrong output on the page, if there is js or other kinds of output on the page. Here is an example:
$tabs->addTab('Skoler')->add('CRUD')->setModel('School');
$crud=$tabs->addTab('Elever')->add('CRUD');
$crud->setModel($student);
if($crud->grid){
$crud->grid->addButton('addStudents')->set('Importer elever')->js('click',$this->js()->univ()
->dialogURL('Importer elever',$this->api->url('importusers&usertype=student'))
->execute());;
$crud->grid->js(true)->addClass('reloadstudent');
$crud->grid->js('.reloadstudent')->reload();
}
When clicking on "Add School" This outputs
$('#barometeradmin_mgr').univ().dialogURL('Importer elever','/redskab/barometer/admin/?page=importusers\x26usertype=student\x26barometeradmin_mgr_tabs_view_htmlelement_crud_virtualpage=add')
in the dialogurl created by the button.
Is there a way to check if the page is loaded for the second time (that is, by the button).
Thanks!
Jeppe
I think all you need to do is leave out the '->execute()'?