0

The link passes the nid and date to another view. List of classes presenting a link to a list of bookings.

In the following example John's class has a link but Jake's class does not.

The 'Add booking' and 'Claim' links work for all classes and pass the url as nid/time where time is in seconds rather than formatted to be passed to views. enter image description here

The date field is setup with the date formatted as follows

enter image description here

The link is created through rewriting

enter image description here

More things that don't work.

  • Turn off Style settings > "add default classes"
  • Just rewrite the text instead of "Output this field as a link". I get the half closed span. This is true if I rewrite the source field.

    2017-09-26AEST14:35">View Bookings

  • Creating a plain text field and rewriting there. Same result as for rewriting inline.

I can see why taking the default classes away might work, as it might stop the date formatter wrapping the text. The link formatter looks like it is removing the span, so any other rewriting doesn't work.

4
  • Try unchecking add default classes for nid and field_when_2 fields configuration.
    – No Sssweat
    Commented Sep 28, 2017 at 0:25
  • I tried it. Didn't do anything. If I view source on where the link should be there is no link rendered at all.
    – Interlated
    Commented Sep 28, 2017 at 1:23
  • Change the text to <a href="studio-manage.../[nid]/[field_when_2]">View bookings [nid]/[field_when_2]</a> and disable Output this field as a link. This may give you some insight into what is going on. Commented Sep 28, 2017 at 4:20
  • I tried using rewrite a number of ways. Couldn't get rid of a 'span'. It is calling a custom entity, so I've worked around the issue by defining the field as filter as 'numeric' rather than date and just passing the raw database value.
    – Interlated
    Commented Sep 30, 2017 at 0:52

1 Answer 1

0

This works if you set up a source field:

  • Create a source field with the date formatting.
  • Rewrite the output of the field with just the tag. [date_when_2] in my case.
  • Select "Strip HTML tags".

Then create a custom text field that rewrites the output as the link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.