Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new template tag which hyperlinks an object, but opens in a new tab when clicked. #5560

Closed
2 of 12 tasks
tsm1th opened this issue Apr 11, 2024 · 2 comments · Fixed by #5629
Closed
2 of 12 tasks
Assignees
Labels
type: feature Introduction of substantial new functionality to the application

Comments

@tsm1th
Copy link
Contributor

tsm1th commented Apr 11, 2024

As ...

P.D. - Plugin Developer

I want ...

I want a template tag similar to hyperlinked_object which adds the target="_blank" attribute.

def hyperlinked_object(value, field="display"):

So that ...

The hyperlinked object opens in a new tab.

I know this is done when...

I add a hyperlinked object using the new template tag and the object opens in a new tab.

Optional - Feature groups this request pertains to.

  • Automation
  • Circuits
  • DCIM
  • IPAM
  • Misc (including Data Sources)
  • Organization
  • Plugins (and other Extensibility)
  • Security (Secrets, etc)
  • Image Management
  • UI/UX
  • Documentation
  • Other (not directly a platform feature)

Database Changes

No database change required

External Dependencies

No new dependencies required

@tsm1th tsm1th added type: feature Introduction of substantial new functionality to the application triage This issue is new and has not been reviewed. labels Apr 11, 2024
@glennmatthews
Copy link
Contributor

Can you give some examples of use cases where you'd want the template to "force" this behavior, rather than giving the user the option to select "Open link in new tab" on their own when that's what they desire?

@tsm1th
Copy link
Contributor Author

tsm1th commented Apr 12, 2024

@glennmatthews I am mostly concerned with the first use case, but provided a second one for conversation sake.

Use cases

  • You want to provide links to other objects on a page with unsaved work.

    • Some custom apps could have pages where the user does a bunch of client side work. You provide them a link on that page to something helpful and they click on it before submitting their unsaved work back to the server.
  • You want to provide links to other objects on a page with media.

    • You might want to provide a link to an object but not interrupt any media that the user is consuming on that page.

@gsnider2195 gsnider2195 removed the triage This issue is new and has not been reviewed. label Apr 22, 2024
@tsm1th tsm1th self-assigned this Apr 23, 2024
tsm1th added a commit to tsm1th/nautobot that referenced this issue Apr 25, 2024
glennmatthews added a commit that referenced this issue Apr 29, 2024
* Added new templatetag to resolve #5560

* Removed kwargs from hyperlinked_object and fixed formatting

* Added new function to build hyperlinks and renamed new filter

---------

Co-authored-by: Glenn Matthews <[email protected]>
@glennmatthews glennmatthews mentioned this issue Apr 29, 2024
2 tasks
edwardtheharris pushed a commit to edwardtheharris/nautobot that referenced this issue Jul 15, 2024
* Added new templatetag to resolve nautobot#5560

* Removed kwargs from hyperlinked_object and fixed formatting

* Added new function to build hyperlinks and renamed new filter

---------

Co-authored-by: Glenn Matthews <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of substantial new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants