Announcement

#1 2012-07-24 11:31:38

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

[resolved] Permalinks - What are they & how do you use them?

What is a Permalink and how are they used/managed?  I've seached the forum, but in 10 pages of results I haven't found anything that described this.

-- Geoff

Offline

 

#2 2012-07-24 11:42:34

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7044

Re: [resolved] Permalinks - What are they & how do you use them?

Have you clic on '?' in admin page for read help file ?

----------------- help --------------------
Permalinks

Permalinks are used to make album urls nicer. When a album has a permalink defined, the id of the album is not required anymore in the url.

When a permalink is deleted, you can save it in the permalink history, so that external links to Piwigo pages still work. In the permalink history table you can see the date when the permalink has been deleted, the last time it was used and the number of times this permalink has been used.

Note that permalinks must be unique per album. Also in the permalink history you cannot have the same permalink defined more than once.

------------------------------------------------


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2012-07-24 11:47:32

pewe
Member
2012-03-16
439

Re: [resolved] Permalinks - What are they & how do you use them?

I looked at these and came to the conclusion it was simply to allow the link to point to a descriptive name rather than an ID number in an album link.

For example:

The link created when adding a new album is:
http://domain.com/photosdemo/index.php?/category/16

Using Permalinks to add a new link name for album ID 16:
http://domain.com/photosdemo/index.php? … /albumname

You can remove the permalink at any time, but then anyone who has it will not be able to access the album, so the permalinkcan be left in the Permalink history so anyone using that will get to the page OK.
(This is explained in the '?' on the permalink admin page.)

As far as I can tell this is the only use for Permalinks - unless some knows something different.

OOPS: ddtddt got there ahead of me - I must learn to type faster ;-)

Last edited by pewe (2012-07-24 11:49:15)

Offline

 

#4 2012-07-24 11:59:16

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] Permalinks - What are they & how do you use them?

Thank you very much for the reply.  I had missed the tab (Admin/Albums/Manage/permalinks tab) where this was managed.  Having to walk through all of the administration pages looking for a reference to "permalinks" isn't what I call documentation.  What's obvious to you as someone who has spent a long time with the product isn't at all obvious to a new user.

Anyhow, once you define a permalink, what's the URL syntax to use it?

-- Geoff

edit:  Seems to be a lot of people typing faster than me.  Thanks pewe for the syntax answer.

Last edited by geoffschultz (2012-07-24 12:01:11)

Offline

 

#5 2012-07-24 12:16:41

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] Permalinks - What are they & how do you use them?

I would have thought that I would be able to achieve the same thing by using "clean" URLs (I'm not sure what phrase to use to describe this).  In my local/config/config.inc.php I have

$conf['category_url_style'] = 'id-name';
$conf['picture_url_style'] = 'id-file';

which generates URLs such as

http://domain/photos/index/category/3-album_name

I would have thought that I would be able to drop the "id" from the "id-name", but when I try

$conf['category_url_style'] = 'name';

it just gives me the album id, such as

http://domain/photos/index/category/3

I really want to have URLs that are relatively permanent and not linked to the database structure.  Then again, I don't want to have to manually generate hundreds of permalinks.

-- Geoff

Last edited by geoffschultz (2012-07-24 12:17:22)

Offline

 

#6 2012-07-24 13:02:52

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7044

Re: [resolved] Permalinks - What are they & how do you use them?

in config default file

--------------------------------------
// php_extension_in_urls : if true, the urls generated for picture and
// category will not contain the .php extension. This will work only if
// .htaccess defines Options +MultiViews parameter or url rewriting rules
// are active.
$conf['php_extension_in_urls'] = true;

// category_url_style : one of 'id' (default) or 'id-name'. 'id-name'
// means that an simplified ascii represntation of the category name will
// appear in the url
$conf['category_url_style'] = 'id';

// picture_url_style : one of 'id' (default), 'id-file' or 'file'. 'id-file'
// or 'file' mean that the file name (without extension will appear in the
// url). Note that one aditionnal sql query will occur if 'file' is choosen.
// Note that you might experience navigation issues if you choose 'file'
// and your file names are not unique
$conf['picture_url_style'] = 'id';

// tag_url_style : one of 'id-tag' (default), 'id' or 'tag'.
// Note that if you choose 'tag' and the url (ascii) representation of your
// tags is not unique, all tags with the same url representation will be shown
$conf['tag_url_style'] = 'id-tag';
----------------------------


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2012-07-24 14:00:34

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] Permalinks - What are they & how do you use them?

ddtddt wrote:

in config default file

My config default file was empty.  This was a fresh install of 2.4.  I added the lines to it.  What else am I missing from the file?

-- Geoff

Last edited by geoffschultz (2012-07-24 14:03:38)

Offline

 

#8 2012-07-24 15:31:09

rvelices
Piwigo Team
2005-12-29
1960

Re: [resolved] Permalinks - What are they & how do you use them?

geoffschultz wrote:

What else am I missing from the file?

Reading

// category_url_style : one of 'id' (default) or 'id-name'.

there is no such thing as name for category_url_style

Offline

 

#9 2012-07-24 15:58:28

geoffschultz
Member
Marlborough, MA, USA
2012-07-01
148

Re: [resolved] Permalinks - What are they & how do you use them?

rvelices wrote:

geoffschultz wrote:

What else am I missing from the file?

Reading

// category_url_style : one of 'id' (default) or 'id-name'.

there is no such thing as name for category_url_style

It works for me!

Offline

 

#10 2012-09-07 17:20:58

Charles
Guest

Re: [resolved] Permalinks - What are they & how do you use them?

To clarify for anyone interested in changing permalinks (for categories, pictures, or tags) and looking for the "config default file" mentioned in other posts - it's in the top level include folder:
include/config_default.inc.php - lines 557 to 572  (in version Piwigo 2.4.3)

The only choices for permalinks for photos are either 'id', 'id-file', or 'file'.
Unfortunately 'name' will not work...though it would be nice to have a plug-in for this.
CB


// picture_url_style : one of 'id' (default), 'id-file' or 'file'. 'id-file'
// or 'file' mean that the file name (without extension will appear in the
// url). Note that one aditionnal sql query will occur if 'file' is choosen.
// Note that you might experience navigation issues if you choose 'file'
// and your file names are not unique
$conf['picture_url_style'] = 'id';

 

#11 2016-08-01 14:02:31

Ruhrpottjung
Guest

Re: [resolved] Permalinks - What are they & how do you use them?

I try to modify the config file but only works half for me.
I used: $conf['category_url_style'] = 'id-name';

Instead of :
http://www.galleryurl.ltd/albumname"
the url is changed for the album to : http://www.galleryurl.ltd/id-albumname"

Is there a way to show the url without the URL ID?

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact