Skip to content

Commit

Permalink
Add rel attributes for Navigation Link #592
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Mar 15, 2024
1 parent c74839b commit 7ef746d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/elements/navigation/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
$menu_params = Style::getSubFormParams($item->params);
$target = isset($menu_params['target']) && $menu_params['target'] ? ' target="'.$menu_params['target'].'"' : '';
$show_title = isset($menu_params['show_title']) && intval($menu_params['show_title']) ? ' title="'.$menu_params['title'].'"' : '';
$rel = isset($menu_params['rel']) && $menu_params['rel'] ? ' rel="'.$menu_params['rel'].'"' : '';
$icon = $menu_params['icon'] !== '' ? '<i class="me-2 '.$menu_params['icon'].'"></i>' : '';
echo '<a id="item-'.$item->id.'" class="nav-link" href="' .$menu_params['link']. '"'. $show_title . $target . '>'.$icon.$menu_params['title'].'</a>';
echo '<a id="item-'.$item->id.'" class="nav-link" href="' .$menu_params['link']. '"'. $show_title . $target . $rel . '>'.$icon.$menu_params['title'].'</a>';
}
echo '</nav>';

Expand Down
1 change: 1 addition & 0 deletions framework/elements/navigation/navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<option value="_parent">Parent Frame</option>
<option value="_top">Full body of the window</option>
</field>
<field type="astroidtext" class="form-control" label="ASTROID_WIDGET_REL_ATTRIBUTE_LABEL" name="rel"/>
</fieldset>
</fields>
</form>
Expand Down
1 change: 1 addition & 0 deletions language/en-GB/en-GB.astroid.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,7 @@ ASTROID_WIDGET_SHOW_TITLE_DESC="Enable/Disable title link"
ASTROID_WIDGET_LINK_LABEL="Link"
ASTROID_WIDGET_LINK_TEXT_LABEL="Link Text"
ASTROID_WIDGET_LINK_TARGET_LABEL="Link Target"
ASTROID_WIDGET_REL_ATTRIBUTE_LABEL="rel attributes"
ASTROID_WIDGET_GLOBAL_STYLES_LABEL="Styles"
ASTROID_WIDGET_MAX_WIDTH_LABEL="Max Width"
ASTROID_WIDGET_MAX_WIDTH_DESC="Set the maximum content width."
Expand Down

0 comments on commit 7ef746d

Please sign in to comment.