Jump to content

How to add external.my_url to lang strings?


KT Walrus

Recommended Posts

Posted

Not sure what to call this, but in the lang files I see the href attributes set to an external value:

'filehandler__Amazon_bucket_desc'	=> "You can create a bucket in your <a href='{external.amazons3_buckets}' target='_blank' rel='noopener'>S3 Management Console</a>

How do I add my "external.my_url" if my lang bit is:

'click_here'	=> "Click <a href='{external.my_url}' target='_blank' rel='noopener'>here</a>!"

Where is this documented? I searched but came up empty.

Posted

Those are just shortcuts to \IPS\Http\Url::ips( 'docs/' . "my_url" ). Don't see why you would need this, can't you just enter the proper URL?  Or do you also need a way to dynamically create links containing the current installed version, which is all that "ips()" method does.

Posted
2 minutes ago, Martin A. said:

Those are just shortcuts to \IPS\Http\Url::ips( 'docs/' . "my_url" ). Don't see why you would need this, can't you just enter the proper URL?  Or do you also need a way to dynamically create links containing the current installed version, which is all that "ips()" method does.

Thanks. I thought this was a way to separate the URLs into one settings table and then use aliases to reference the URLs in the code. Being an IPS shortcut doesn't do what I want. I will stick with holding these URLs in my app's settings (so they can be updated, if needed), rather than in the lang bits using some templating syntax to specify external URLs.

Posted

As mentioned, the URL pattern referenced ultimately passes a shortcut code through our documentation endpoint, which allows us to adjust where to send users when they click documentation links (i.e. if we create a new separate article for a new version). It won't be of any use for you I'm afraid, and you'll need to either hardcode the URL into the language file or reference it in some other manner (e.g. %s and then swap out with \IPS\Settings::i()->whatever).

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...