Third level in the folder hierarchy using Relative Path - path

I'm trying to use relative path to link back to the index.htm in a webpage I'm making.
Can relative path go beyond "../" , can it go beyond 2 dots ??
It's not working when I use ".../" , 3 dots.

Jon answered this in his comment, you need to repeat ../ for each level you want to go up

Related

Is there a name for the dots and forward slashes (i.e. "./", "../", "../../", etc.) at the beginning of relative file paths? What is it?

For clarification, I'm just talking about relative file paths that also include a directory or filename in them, for example ../../some_directory/my_file.ext. I understand that ./ is current directory and ../ is parent directory and that on their own they are in fact relative paths.
But, I am wondering in the context of a relative path that includes directory/directories and possibly the filename and extension after the dots and slashes, what are the dots and slashes known as? The "directory referrer", "path adjuster", etc.?
I'd like to know, because I have a function that creates this portion of the relative path based on target folder's depth (which I am calling frequently throughout my app) and I'd like to give it a name that will help make my code more legible to others. Right now I'm calling them dotSlashes and the function is called prependDotSlashes.
I've googled and stackoverflowed around, but didn't find a definitive name.
If anybody knows the industry-standard name for this portion of relative file paths, I would be curious to know it.
Man, I know the dot as "current directory", and the slashes as directory separator.
The double dots (..) is know as parent directory.
Relative path is a path relative to where you are. Eg: If you are in the /etc path, then, the ./apache path is a relative to that /etc. A full string path (from the root) is named absolute path. So, for example:
../../../../ => Relative path
/home/user/Documents/doc1 => absolute path
./Document/doc1 => relative path from home

In Laravel 5.6, how do I create relative links?

I'm new to Laravel (using 5.6) and can't get my links to work.
My directory structure is: resources/views/pages/samples
In the samples directory, I have 10 blade files I want to link to (named "sample1.blade.php", etc.). I have a "master" links page in the pages directory (one level up from samples).
I've tried the following but can't get any of them to work correctly...
Sample 1
Sample 1
Sample 1
Sample 1
...and a few other variations.
I've also tried adding a base tag to the HTML header but that doesn't help.
Every time I click a link, it says "Sorry, the page you are looking for could not be found."
What am I missing?
Thanks #happymacarts, I didn't realize I had to add a path for every single page in my site.
After adding the paths, the links are working.
I will get into the practice of updating the paths every time I add a page.

How to split Bazel file path into external dependency directory and relative path?

I'm working on a custom rule in skylark that is trying to use the proto compiler. Due to intricacies of how it works, I need to split a path into a directory for the external dependency and the path part that is relative to that.
Example1:
File:[/private/var/tmp/_bazel_endobson/c56b77af296477cd0f319aa9d4ce1d19[source]]external/googleapis/google/devtools/build/v1/build_status.proto
I want the paths:
/private/var/tmp/_bazel_endobson/c56b77af296477cd0f319aa9d4ce1d19/external/googleapis/
google/devtools/build/v1/build_status.proto
Example2:
File:[[/private/var/tmp/_bazel_endobson/c56b77af296477cd0f319aa9d4ce1d19/execroot/bes_example]bazel-out/darwin_x86_64-fastbuild/genfiles]external/com_google_protobuf/google/protobuf/any.proto
I want the paths:
/private/var/tmp/_bazel_endobson/c56b77af296477cd0f319aa9d4ce1d19/execroot/bes_example/bazel-out/darwin_x86_64-fastbuild/genfiles/external/com_google_protobuf
google/protobuf/any.proto
The issue is that bazel allows accessing the root and root relative parts of the path, but doesn't give insight into if the path has the 'external/' part or not. The protocol buffer compiler needs this because it needs to know the directories that correspond to the root directories from the user's point of view so that it can use relative paths from the source.
Is there a principled way of detecting this other than hackily looking at the path to see if it has 'external' in it?
I'm afraid I cannot give you a really great answer here :( Eventually, we'd like to remove the "external" path segment, but it hasn't happened yet. The current rule is that you have it for source artifacts, but you don't have it for generated artifacts.
Thus, what I'd do is exactly what you suggest -- check if the first path segment is "external".

Setting a hyperlink using a relative path

Here are my example folders and documents
c:\b.odt
c:\myfolder
c:\myfolder\a.odt
I would like to create a hyperlink in a.odt that references b.odt
The direct path for the hyper link will look like this: c:\b.odt
However different people will have different paths. However, b.odt will always be in the same directory as myfolder.
I tried to use ./ but it wasn't working.
Is there a way I can make a hyperlink without the direct path?
https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=54592
Make sure you select the Document option in the Hyperlink dialog (as opposed to Internet. You may also have to preface with "file://" and/or apply the relative links setting in Options -> Load/Save -> General.

Typo3 : using typoscript to modify the base-url

I am trying out TYPO3's introduction package. For that I am using Xampp on my computer.
I have installed it in a subdirectory, but since it uses "real-url", I need to modify the generated links, so that instead of http://localhost/about-typo3/ I get http://localhost/subfolder/about-typo3/
I believe it must be done via "typo-script", and from what I have read on the Internet, this line should do the job :
config.baseURL = http://localhost/subfolder/
But I don't know where I should put it. I have tried different locations, but with no apparent effect.
So what I would like to know is : am I on the good path for what I need to do, and if yes, what should I try now ?
This is a bug in the 4.6 Introduction Package. 4.7 will ship with a correct version, so you might just want to go ahead and try the Introduction Package from 4.7RC2 (Preview Releases).
For now, just choose Template in the module menu on the left. Then use the dropdown to select Constant Editor. Now choose the page HOME in the pagetree on the middle.
Now use the second dropdown to select CONFIG. There modify the topmost setting Absolute URI prefix. Input your full domain without the last slash (/). That means copy your current URL from the browser and strip /typo3/backend.php. Now save with the little save icon in the top toolbar.
This will also invalidate all caches for you (because you changed the topmost template). No need to install extra extensions or to do this manually.
Alternative you can fix the actual bug. Go to template module and select the folder TypoScript Templates / page_configuration. Now select Info/Modify instead of Constant Editor and directly above the table page.config. The click the pencil left of Setup. Find the line absRefPrefix = {$config.absRefPrefix}/. This should be around line 62 (4.7RC2). Remove the last slash (/) from that line and save. Because you are not on the topmost template, you need to clear the cache. On the topright of your screen, you can find the yellow flash icon. Click it and select Clear all caches (red flash). Now go to you website again.
A general note about (config.)baseURL. This is more a hack, because it just tells the browser to behave as if the website would be at another place. The correct way is to create correct links in first place. You should use (config.)absRefPrefix instead. To make this work in auto mode, it must be completely empty (config.absRefPrefix =).
Do not use baseURL any more. The next Introduction Package will not have this setting.
Yet another note: If you use the config.absRefPrefix, you have to include the last slash (/). The only reason why you do not have to do so above (in the constants), is because it is hardcoded in the template and thus also preventing the automatic detection to work.
If you are using different hosts, you can use typoscript conditions in your root template:
# Default:
config.baseURL = http://www.example.com/
[globalString = ENV:HTTP_HOST=sub1.example.com]
config.baseURL = http://sub1.example.com/
[global]
[globalString = ENV:HTTP_HOST=sub2.example.com]
config.baseURL = http://sub2.example.com/
[global]
if you are using introduction package. there is Constant for set the base url
Go to 'Template' and 'Constant Editor.. you can find 'Domain name for Base URL [config.domain]' .. for setting base url
also you can put the
config.baseURL = http://localhost/subfolder/
on 'Info Modify' Setup field
hope will help you .. sorry for my bad english

Resources