Untitled

 avatar
unknown
plain_text
a month ago
1.3 kB
3
Indexable
in below code i have used customurlOne parameter that takes url value but in authoring and frontend i have used variable linkOne that overrides the value entered by user to frontend but i have to check if user hasn't eneterd any value then previously whatever is coming in link one that is shown if user has eneterd any url in given textarea then show that on frontend the variable that shows values on frontend is linkone but in textarea i do not want already values that is present that shows up i want that textarea to be empty when user enters anything then write there
<PanelRow>
{postOne && postOne.id && (
<TextControl
label={__('Custom Article Url', 'blackstone')}
help="Optional url that will override the title url of this selected article."
value={customUrlOne}
onChange={(customUrlOne) => {
setAttributes({ customUrlOne });
}}
/>
)}
</PanelRow>

<div class="bx-featured-single-left-content">
									<h4 class='bx-article-featured-title bx-article-featured-title-if-description bx-article-title-authoring'>
										<a href={ linkOne ? linkOne : postResponseDataOne.link} className="bx-content-card__title-link">
											{customTitleOne ? customTitleOne : postTitleOne}
										</a>
									</h4>
								</div>
Leave a Comment