I am trying to convert home text to font fonts in Navbar's breadcrumbs (Moodle 2.7).
I override core_render.php using a file from the shelles topic.
I have started to change after the breadcrumb array
[0] ; That's half of the work is replaced by the icon but href & lt; A & gt; I do not expect the tag's attributes; It follows navigation, no home URL.
I do not know where this link is made. How can I use the FontAvonne icon when placing a home URL?
Here is the code:
theme_bootstrapbase_core_renderer theme_bootstrapbase_core_renderer extends theme_bootstrapbase_core_renderer {/ * * it render navbar * uses bootstrap compatible html * / public function navbar () {$ Items = $ this- & gt; Page-> Navbar-> Get_items (); If (right_to_left ()) {$ dividericon = 'fa-angle-left'; } And {$ dividericon = 'fa-angle-right'; } $ Divider = html_writer :: tag ('span', html_writer :: start_tag ('i', array ('class' = & gt; 'fa'. $ Dividericon. 'Fa-lg')). Html_writer :: end_tag 'I'), array ('square' => 'divider')); $ Breadcrumbs = array (); Forex Currency ($ item $ item) {$ item- & gt; Hideicon = true; $ Breadcromb [] = $ this- & gt; Render ($ item); } // Change the first entry $ breadcrumbs [0] = '& lt; A href = "" & gt; & Lt; I class = "fa-fa-home fa-2x" & gt; & Lt; / I & gt; & Lt; / A & gt; ; $ List_items = html_writer :: start_tag ('li'). ("$ Divider". Html_writer :: end_tag ('li'). Html_writer :: start_tag ('li'), $ breadcrumbs). Html_writer :: end_tag ('li'); $ Heading = html_writer :: tag ('span', get_string ('pagepath'), array ('square' => 'access-hyde')); $ Heading back Html_writer :: tag ('ul', "$ list_items", array ('class' => 'breadcrumbs')); }}
] = $ This- & gt; Render ($ item);
The function will call (I think - I have not checked it again again)
This function takes every item in the breadcrumb and turns it into an example of navigation_node A string
If you want the first item to be linked to 'home', then with your chosen icon, you might possibly be away from it:
$ Breadcrumb [0] = html_writer :: link (new moodle_url ('/'), html_writer :: tag ('i', '', array ('class' => 'fa-home fa-2x') ));
An alternative would be to see if you can change the 'content' item of $ 'items in the items you want to have the icon before you open the loop and call render Make () on each item.
Comments
Post a Comment