Answer the question
In order to leave comments, you need to log in
How to compose a link (href) from the span result?
Hello, I am editing one site, making changes to plugins.
Faced such a problem, there is a plugin that leaves reviews with ratings, in other words Review.
His review looks almost like a regular comment, but with stripes (stars) of ratings, a brief info about the user is also displayed, in the form of a name, avatar.
So the username is just text, that is, the plugin does not interact with bbpress or any other user profile plugins, but I have another plugin where the profile opens at the link https://mysite.ru/profile/. By writing what you see below, I made the username that is displayed as text also turn into a link
<a href="https://мойсайт.ru/profile/" <span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>
<span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>
< is the only way to get the username. My question is, can the value that is obtained by calling this<span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>
put in the link in place of the username, like this https://mysite.ru/profile/username/ ? <span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>
Answer the question
In order to leave comments, you need to log in
<a href="https://мойсайт.ru/profile/{{ review.rating_user_name}}"><span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>
<a :href="`https://мойсайт.ru/profile/${review.rating_user_name}`"><span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question