Skip Navigation

[Resolved] cred_child_link_form attributes

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by MattI4840 4 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1675547

Tell us what you are trying to do?

I am using the 'cred_child_link_form' shortcode to link to a post form which is working without issue. However, I'd like to pass in an additional parameter to auto-populate one of the fields on the form. It appears from the documentation there is a way to add further attributes, but I'm unsure if this can be used to pass in parameters similar to the way the parent_id is passed in. Since there are no examples in the documentation of this shortcode with additional attributes, can you let me know if this is what that option is meant for, and if so a syntax example?

Is there any documentation that you are following?

https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/

Thanks!
Matt

#1675575

Just a quick update, I was able to get the output I was looking for by discarding the shortcode and manually forming the link and inserting field shortcodes per the below. This is more of a work around though, so I'd still like know if this can be done more easily with additional attributes in the cred_child_link_form shortcode.

<button><a href="<em><u>hidden link</u></em> item='@customer-discount.child']" target="_self">New Estimate</a></button>

Thanks,
Matt

#1676227

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you may already have checked the shortcode: cred_child_link_form
=> https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_child_link_form

There is no attribute available to set the additional params that you can pass to URL. So, as far as I can see the workaround you use is the perfect solution in this case.

#1676759

Understood Minesh, I don't mean to be a bother, but could you kindly let me know what the attributes argument can be used for, the example says additional HTML attributes like onclick, but again there isn't any syntax example so I'm unsure how to implement it and now my curiosity is peaked.

Thanks,
Matt

#1677839

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Toolset Form's cred_child_link_form shortcode offers you the way you can set the attributes like class, target, style using GUI.

I checked the source code that generates the cred_child_link_form link and I found the following line:

	return "<a href='{$link}' " . implode( ' ', $_atts ) . ">" . cred_translate( 'Child Link Text', $text, 'CRED Shortcodes' ) . "</a>";

As you ca nsee the attributes are the addon attribes you can pass like onclick, rel etc..etc..

You can see the supported attributes for the anchor tags here:
=> hidden link

#1678033

My issue is resolved now. Thank you!