How can I add a block of text to the Home page?
Best Answer
-
john_doyle Cireson Support Ninja IT Monkey ✭✭✭✭@NIcholas_Scott,
You can try adding this code to the custom.js file:$(window).load(function() {<br> if (window.location.pathname == "/View/94ecd540-714b-49dc-82d1-0b34bf11888f")<br> $("#alertMessagesContainer").before("<div class='col-md-12'>Some useful information</div>");<br>});
Change the pathname if necessary to match the Home page you are using and then add the HTML code you require.
1
Answers
You can try adding this code to the custom.js file:
Change the pathname if necessary to match the Home page you are using and then add the HTML code you require.
I want to do the same described here. I'm struggling to add the text after the "Home". I added code in the onload function only for endusers on the homepage, but I'm not able to add the text at the required position. Can you give me an example how to add the paragraph after the headline "Home"?
@Ann-Christin_Weiergr what do you have so far - can you share your code?
I tried different approaches e.g. described here: https://community.cireson.com/discussion/comment/4217#Comment_4217
My current approach is the following:
$(window).on("load",function () {
if (!session.user.Analyst && window.location.href.indexOf('IDofHomepage') > -1){
text = $('<h4>Das ist die Beschreibung</h4>')
$('h1').after(text);
}}
Thanks!
Here you go - I don't know if you already has a script loader in your custom.js but else this is the full guide 😊
Place this code in your custom.js file:
Then put this code into af file called AddTextToHome.js and place it in your CustomSpace folder