cancel
Showing results for 
Search instead for 
Did you mean: 

Add Title to Fiori Framework Page

SandipAgarwalla
Active Contributor
0 Kudos

Hi All

Is there a way to add a Title Text to the Fiori Framework Page's header bar, something like this

Is there any configurable property available in the Framework?

Thanks

Sandip

Accepted Solutions (1)

Accepted Solutions (1)

SandipAgarwalla
Active Contributor
0 Kudos

bump, anybody??

Can you please help here? Is there a way we can modify the FFP?

Thanks

Sandip

saar_dagan
Employee
Employee
0 Kudos

Hi Sandip,

There should be an API, depending on the FLP version the portal uses.

If this should be something that is static (doesn't change at all) you can even do it in CSS using the theme designer .

BR,

Saar

SandipAgarwalla
Active Contributor
0 Kudos

Thanks Saar

I found the API which can help, but not sure how to add it to the framework page? Do you know the framework file name that needs to be modified?

The text will mostly be static, I think CSS would be a better option. I will explore this one.

Thanks

Sandip

saar_dagan
Employee
Employee
0 Kudos

Hi Sandip,

I found the API, it is quite simple I think using it is not a bad idea.


var oRendererExtensions = jQuery.sap.getObject("sap.ushell.renderers.fiori2.RendererExtensions");

oRendererExtensions.setHeaderTitle("test");

You can easily create even your own javascript code to manage this header title easily and just create an iView that will include the javascript code.

Put the iView as the last part of the framework page, make sure it has no tray and it will work great.

When using the CSS option you should only do it if your title will not change at all, if you want to change it you will need JS code anyways so it is better to use the API.

BR,

Saar

SandipAgarwalla
Active Contributor
0 Kudos

Hi Saar

finally got a chance to test it, it didnt work. I added the script as KM document iview and added it to the framework page, but nothing.

here is the content of the document


<script type="text/javascript">

var oRendererExtensions = jQuery.sap.getObject("sap.ushell.renderers.fiori2.RendererExtensions");

oRendererExtensions.setHeaderTitle("Limited Edition Portal");

</script>

Are you getting the results when adding the script as document iview?

Thanks

Sandip

saar_dagan
Employee
Employee
0 Kudos

Hi Sandip,

KM is running inside of an iFrame, I think this might be the issue here.

first you must relax the domain and then try to get the EPCM top to get the correct jQuery object.


<script>

var lnDotPos = document.domain.indexOf( "." );

if(lnDotPos>=0){

  document.domain = document.domain.substr(lnDotPos+1);

}

tPos+1);
</script>
then you can use:

try var oRendererExtensions = EPCM.getSAPTop().jQuery.sap.getObject("sap.ushell.renderers.fiori2.RendererExtensions");

oRendererExtensions.setHeaderTitle("Limited Edition Portal");


Answers (2)

Answers (2)

bhaskar_kuntla
Participant
0 Kudos

Hi all,

Even i need to implement the same.

Can you please suggest me that where do i need to upload JS file with

var oRendererExtensions = jQuery.sap.getObject("sap.ushell.renderers.fiori2.RendererExtensions"); 

oRendererExtensions.setHeaderTitle("Title Name "); 


I mean how to call this js file (in which class ).


Do we need to add this in the Fiorilaunchpad.html or is there any way to add with out touching the standard code.


And also can you please tell me from where <title> home<title> is loading. Since i need to change the text "home".


Please suggest me.


Thanks,

bhaskar.

former_member193577
Active Contributor
0 Kudos

Hi,

Try the following,

var oRenderer = sap.ushell.Container.getRenderer("fiori2"); oRenderer.addHeaderItem("sap.ushell.ui.shell.ShellHeadItem", {id: "testBtn"}, true, true);

Or the following:


var bar = new sap.m.Bar();

var oRenderer = sap.ushell.Container.getRenderer("fiori2");

oRenderer.showSubHeader([bar.getId()], false, ["home", "app"]);

This depends on your UI5 Version.,as it may not be available.

Best Regards,

Tal