diff options
author | Thomas Lange <code@nerdmind.de> | 2017-05-24 22:24:06 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-05-24 22:24:06 +0200 |
commit | c0c31342527cfc78f2b3996dcf4be023489e2d1c (patch) | |
tree | e8127c802cff41a0b32db5e94b59ff26b83c533e | |
parent | c3234437af92c81d5ede3ae66b9fe0e7fcd3b0af (diff) | |
download | wiki-c0c31342527cfc78f2b3996dcf4be023489e2d1c.tar.gz wiki-c0c31342527cfc78f2b3996dcf4be023489e2d1c.tar.xz wiki-c0c31342527cfc78f2b3996dcf4be023489e2d1c.zip |
Editor document added.
-rw-r--r-- | Editor.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Editor.md b/Editor.md new file mode 100644 index 0000000..158b660 --- /dev/null +++ b/Editor.md @@ -0,0 +1,27 @@ +If you wanna link an item of your blog application, please don't put the absolute URL hardcoded into the content editor. What if you want to change your sites address (or just the base directory) in the future? You would have to change all the hardcoded links in your content. This is not cool! Thus, you can use the following special syntax within the content editor to link any resource of your installation dynamically. + +**Note:** You can combine these codes with markdown syntax because the special codes are processed before the markdown parser starts. The markdown parser will never see the original syntax of this special codes, but rather the result (an absolute URL) of those. + +## Dynamic linking of resources +You can link resources which are located anywhere within your installation dynamically, either relative to your base directory or relative to your `rsrc` directory where you store your content like images and other files (this is the preferred method to include an image within your items content): + +* Write `{BASE["other/directory/"]}` into the editor and get `https://hostname/other/directory/` +* Write `{FILE["image/foobar.jpg"]}` into the editor and get `https://hostname/rsrc/image/foobar.jpg` + +### Combined with markdown syntax for displaying images +* Write `![A foobar image]({FILE["image/foobar.jpg"]})` into the editor and get `<img src="https://hostname/rsrc/image/foobar.jpg" alt="A foobar image" />` + +## Dynamic linking of pages, posts and users +You have to know the unique ID of the item which you can find in the administration area, so that the system can identify it and replace the code with the items URL (if you put an ID into the syntax which does not exists, the output in your HTML will be just `{undefined}`): + +* Write `{PAGE[123]}` into the editor and get `https://hostname/page/page-with-id-123/` +* Write `{POST[123]}` into the editor and get `https://hostname/post/post-with-id-123/` +* Write `{USER[123]}` into the editor and get `https://hostname/user/user-with-id-123/` + +### Combined with markdown syntax for URL linking: +* Write `[A cool page]({PAGE[123]})` into the editor and get `<a href="https://hostname/page/page-with-id-123/">A cool page</a>` +* Write `[A cool post]({POST[123]})` into the editor and get `<a href="https://hostname/post/post-with-id-123/">A cool post</a>` +* Write `[A cool user]({USER[123]})` into the editor and get `<a href="https://hostname/user/user-with-id-123/">A cool user</a>` + + + |