Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions system/handlers/renderers/content/Link.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @feature cms
*/
component {
property name="linksService" inject="LinksService";
Comment thread
qianqianlim marked this conversation as resolved.
Outdated

public string function default( event, rc, prc, args={} ){
var linkId = args.data ?: "";
Expand All @@ -13,4 +14,14 @@ component {
return "";
}

private string function dataExport( event, rc, prc, args={} ) {
var link = getPresideObject( "link" ).selectData( id=args.data ?: "" );

if ( !link.recordCount ) {
return "Link not found";
}

return linksService.getLinkUrl( link.id );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate record exists check since the in the getLinkUrl already check that, and there is a helper for getLinkUrl could make use of it

}

}
4 changes: 3 additions & 1 deletion system/i18n/preside-objects/url_redirect_rule.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ field.redirect_type.title=Redirect type
field.redirect_type.help=Whether the redirect is a permanent or temporary redirect. If in doubt, choose the default 'permanent' redirect.

field.keep_query_string.title=Preserve URL parameters
field.keep_query_string.help=If true, any URL parameters found at the incoming URL will be added to the target URL.
field.keep_query_string.help=If true, any URL parameters found at the incoming URL will be added to the target URL.

field.rendered_redirect_link.title=Redirect to link
1 change: 1 addition & 0 deletions system/preside-objects/url_redirect_rule.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ component extends="preside.system.base.SystemPresideObject" displayName="URL Red
property name="keep_query_string" type="boolean" dbtype="boolean" required=false default=false;

property name="redirect_to_link" relationship="many-to-one" relatedto="link" required=true;
property name="rendered_redirect_link" type="string" dbtype="text" formula="${prefix}redirect_to_link" adminRenderer="none" dataExportRenderer="Link" searchSearchable=false autofilter=false;
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it is a formula field, dbtype won't required to defined as well as 'searchSearchable' shouldn't be here.
wondering the reason behind set the admin renderer to none as well.

(and I think redirect_to_url might be more suitable for the data rendered?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin renderer = none to hide it in the record detail's admin view

Image

}