HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Internal Cedi-Links

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#63011 (In Topic #13673)
Avatar

Well-settled

Hi there,

I found in the Cedi-tutorial that we can link to another Cedi page by putting the the target page's name into double sq brackets. Works fine for page names without spaces, but doesn't seem to work for multi word page names. Can we link to other cedi pages by their ID, too?

Have a nice one,
Low
Back to the top
 
Posted
Rating:
#63017
Avatar

Hi,

Just ran a test – it seemed to work fine actually. Could you give an example of some Comcode that doesn't work?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63018
Avatar

Well-settled

Chris,

thanks for testing! I found that it does in fact work with multi-word page names, but a friend of mine created a cedi page name of "TR8: NOTHING LESS THAN THE REINVENTION OF THE SPORTS CAR.", which I think is a valid page name, but doesn't work as a link. Must be the colon and/or the full stop. Page names with slashes in them actually work as links. Is there a list of characters that should generally be avoided in page names?

Have a nice one,
Low
Back to the top
 
Posted
Rating:
#63021
Avatar

I am guessing the Comcode parser only reads-ahead so far, so it may be a length thing. I will test.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63022
Avatar

Yeah, it's related to length. There's a line (roughly 713) in sources/comcode_text.php. Change:

Code

if (preg_match('#^\[([^\[\]]*)\]\]#',substr($comcode,$pos,40),$matches)!=0)
to:

Code

if (preg_match('#^\[([^\[\]]*)\]\]#',substr($comcode,$pos,100),$matches)!=0)


We'll make this change in the next patch release too. It puts the limit up to 100, which I think is reasonable.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63028
Avatar

Well-settled

Chris,

works like a charm now. Thank you!!

Regards,
Low
Back to the top
 
Posted
Rating:
#63072
Avatar

Well-settled

Hi,

I don't want to be too bold here, but Comcode doesn't allow an alternative Text for such a link, does it? Or even an image?

Something like

Code

[[pagename|text appearing as link instead of actual pagename]]
Have a nice one,
Low
Back to the top
 
Posted
Rating:
#63115
Avatar

You could use the 'page' or 'url' tags instead to achieve this.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63117
Avatar

Well-settled

Ok, I see. What I don't see yet is the syntax. I know the page tag is described in the Comcode tut, but this tut, - like many others - and I say that with all ever possible respect - could benefit from the occasional example to save hours of trial and error. Could you give me just one example, please?

I try to link to a cedi page shows in the browser as:

Code

http://www.mywebsite.de/site/index.php?page=cedi&type=misc&id=1%2F4%2F7
My last and I think so far most plausible try was:

Code

[page="site/index.php?page=cedi&type=misc&id=7" caption="testlink"][/page]
but that is completed to

Code

http://www.mywebsite.de/site/index.php?page=cedi&type=misc&id=7/index.php?page=start
which obviously can't work.

I tried

Code

[page="site" caption="testlink"]cedi&type=misc&id=7"[/page]
as well, but this is rendered as

Code

http://www.mywebsite.de/site/index.php?page=cedi%2526amp%253Btype%253Dmisc%2526amp%253Bid%253D7%2526quot%253B
which looks good from the left side, but fails at the first "&".

I'm awfully sorry to have to ask such basic questions here after months of trying to get our website straight. And we have yet to touch the catalogues, the newsletter module and the shop…

Problem is, if you run into not knowing how to achieve x or y in OCP and you don't find out yourself how to do it in hours of trying and there's no example in the tutorials and it has not been asked in this very forum, you're basically stuck (avoiding common slang word for the feeling here :$ ).

Have a nice one,
Low
Back to the top
 
Posted
Rating:
#63118
Avatar

I completely understand. It's difficult for us to know what's badly documented so it's a huge favour when you explain like this.

The syntax would be…

Code

[page="site:cedi:misc:7"]Whatever title you wish for[/page]

We'll document it better now that we're aware it's unclear. (Y)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63266
Avatar

This should be clearer (updated doc):

Tag Purpose Parameters Embeds

page

Show a link to an ocPortal page. It is much preferable to use this rather than the 'url' tag, because it is more resistant to architectural changes (for example, if suddenly ocPortal was written in something other than PHP, URLs to index.php would no longer work, but page links would; if the domain name was changed the links would also continue to work).

This tag has two very distinct usage patterns, where parameters/embed-text are interpreted differently.

  1. If only a 'param' parameter and embed-text is given, then the embed-text becomes the caption, and 'param' becomes a page-link .
  2. The other usage pattern is as described on the right.

param – the zone the page is in

caption – the link caption. Supports Comcode.

Other parameters are actual parameters to place inside the URL. For instance 'type' and 'id' are likely to be used, as these are very commonly found in ocPortal URLs.

The page name

Examples:
  1. [page="site:downloads:misc:2:foo=bar"]Downloads[/page]
  2. [page="site" type="misc" id="2" foo="bar" caption="Downloads"]downloads[/page]


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63267
Avatar

I'll add this: never underestimate our ability to be completely ignorant of confusing aspects of the documentation. It's very difficult to step back and see things as a regular user would.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#63312
Avatar

Well-settled

Chris,

thanks (again) for your time. I think it's the examples which do the trick and make the documentation understandable. Without the second example (i.e. by the descriptive text only) I'd never ever would have figured out where to put the "downloads" part in the "other" usage pattern.

Have a nice one,
Low
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: