M
M
mdatrash2017-10-24 11:14:05
WordPress
mdatrash, 2017-10-24 11:14:05

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>

But the problem is that https://mysite.ru/profile leads to the profile of the current authorized user, in order to get to a specific user, you need to write like this https://mysite.ru/profile/username/ In
the plugin, in the file that is responsible for the reviews left by the above method, namely
<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/ ?
PS The original version in the plugin displays just the username as text and looks like
<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

2 answer(s)
D
Dmitry Luzanov, 2017-10-24
@mdatrash

<a href="https://мойсайт.ru/profile/{{ review.rating_user_name}}"><span class="rwp-u-review__username" v-text="review.rating_user_name"></span></a>

So have you tried it?
As I understand it, vue is used in the face .

A
Artur Bordenyuk, 2017-10-24
@HighQuality

<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 question

Ask a Question

731 491 924 answers to any question