Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Django-cms link to a page
#1
Hello i'm stuck with a stupid problem probably.
I'm trying to insert a link to another page on the same site in a text plugin, but i can't figure out how...
I tried {% page_url ... %} but the link became "http://...../{% page_url ...%}" obviously wrong :)

Thanks
Reply
#2
Why is that wrong? All urls start with http[s].
Reply
#3
Tnx for the answer and sorry for my english, i meant it does not translate the template tag {%page_url 'article1detailed'%}, it should became
http://127.0.0.1:8000/dcms/art1

while it remains
http://127.0.0.1:8000/dcms/{%page_url 'article1detailed'%}

I don't want to hardcode the link, because if I move the page in the tree, i'll have to change all the links manually :)

I'm sure i'm missing something very stupid...but the tutorial and documentation lack of examples :)

On this book beginning django-cms i found
Quote:The Link Plugin
The Link plugin (Figure 6-4) inserts a link into the page content. It can also be used to
insert links inside the Text plugin and the Multi Columns plugin. There are five link types
available—Link (URL), Link to a Page on the Site, Link to an Anchor, Email Link, and
Telephone Link.
But there is no more Link to a Page on the Site in the last version of django-cms
Reply
#4
page_url isn't part of a plugin, it's core Django: http://docs.django-cms.org/en/latest/ref...l#page-url

Do other template tags work? What version of Django are you running?
Reply
#5
I supposed so, that was a desperate attempt :)

Django (1.11.11)
django-cms (3.5.1)
Python 3.4.2

What's the correct way to add a link(to a page on the same site) in a text plugin using the name or id, without hardlinking it?

Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  <title> django page title dynamic and other field (not working) lemonred 1 2,093 Nov-04-2021, 08:50 PM
Last Post: lemonred
  Download a link that re-directs to a login page justanotherpythonnoob 1 2,687 Oct-23-2020, 03:27 PM
Last Post: Aspire2Inspire
  [Django] css file is not applying to the page SheeppOSU 1 3,058 May-09-2020, 06:54 AM
Last Post: menator01
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 3,618 Mar-19-2020, 06:13 PM
Last Post: apollo
  SHow image in a static link of Django pycada 3 2,539 Mar-04-2020, 01:50 AM
Last Post: pycada
  Django Two blocks of dynamic content on one page iFunKtion 5 4,396 Jul-04-2019, 02:31 AM
Last Post: noisefloor
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,293 Jun-30-2019, 12:21 AM
Last Post: scidam
  get link and link text from table metulburr 5 6,273 Jun-13-2019, 07:50 PM
Last Post: snippsat
  Sorting getting off, when I switch page Django 1.11 m0ntecr1st0 0 1,973 Feb-12-2019, 06:40 PM
Last Post: m0ntecr1st0

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020