Welcome to the Koken CMS community!

Here at KCS, you will find a friendly bunch of photographers who like to share their love for the Koken CMS. We hope that you will enjoy your time here and thrive in our community!

You asked for it: Donations!
You asked for it, and it's here: The possibility to "buy me a beer (or more)"!

Seriously: By giving a small paypal donation you will help with keeping this site afloat and also give me more incentive to develop OxyGen further... ;)

// Bjarne Varöystrand and the KCS Team
Koken Development

Redirecting an Album to a Page

Theme editing, customization and publishing.
Official documentation is here
Forum rules
As of late, we have been seeing cases where some of you have been posting multiple types of questions within a singular type of topic...

This makes searching here a nightmare for people whom are attempting to find out whether or not their question has already been asked, or possibly even answered. Therefore, I would like to implement some very basic rules, which I think everybody will be happy with, given that they will lead to better search results.

  1. All public communication is done in English
  2. ONE question per topic
  3. Make the title descriptive
  4. If it's regarding a theme: make sure you mention the theme name.
  5. Leave a URL to your site, since sometimes, custom "hacks" and CSS will be uniqe to your site.

I believe that these simple rules will not only make our lives easier, but also the lives of our visitors :D

I am of the opinion that ignoring these requests will make it harder for us all.
Plus, we won't be able to actually mark an issue/topic as solved, since it would be more difficult to determine what we're actually trying to solve! For example: Are we addressing the first, second or third question?
c3imagazineshop
User
User
Posts: 12
Joined: Thu 21 Jun 2018, 00:28
Your name: Steve

Redirecting an Album to a Page

Postby c3imagazineshop » Thu 21 Jun 2018, 00:31

Hi, I am trying to modify the links of a set of albums I have to redirect to pages instead of into the album itself. I have seen suggestions to modify the site publishing to change how all album links are handled, but I only want to change the links on this one album page. The albums are used throughout the site in traditional capacities, so I want to leave the rest of them alone and just change the album links in this one instance/webpage.

I can change the slug, but that doesn't help out either. I want to change http://www.example.com/koken/albums/album-contents/ to http://www.example.com/koken/pages/page-contents/
User avatar
Bjarne Varöystrand
Webbplatsadministratör
Webbplatsadministratör
Posts: 1063
Joined: Sun 29 Mar 2015, 21:02
Your name: Bjarne Varöystrand
Location: Lysekil, Sweden
Contact:

Re: Redirecting an Album to a Page

Postby Bjarne Varöystrand » Fri 22 Jun 2018, 00:23

The only way to achieve this (without rewriting anything) is to use some plain old JavaScript/jQuery :ugeek:
And for some reason I actually posted this solution "ages ago" (It's actually three years since I posted it)!
Inject code/html in only ONE page

For your case you could try to use this in the HTML Injector plugin

Code: Select all

<script>
   $(function() {
      if (location.href === '/koken/albums/album-contents/') {
         window.location.replace("http://www.example.com/koken/pages/page-contents/");
      }
   });
</script>
Hope this can help you on the way 8-) :D
Regards
Bjarne Varöystrand - Image || Reddit || Twitter|| Facebook

Image
c3imagazineshop
User
User
Posts: 12
Joined: Thu 21 Jun 2018, 00:28
Your name: Steve

Re: Redirecting an Album to a Page

Postby c3imagazineshop » Sat 23 Jun 2018, 00:44

Hmm, I follow but it doesn't seem to translate exactly with my situation, maybe it's the specific script itself you used? (window.location.replace) What other scripts might work here?

Here are the sample pages: on http://www.c3iopscenter.com/koken/sets/ ... torefront/ I have a number of albums, including http://www.c3iopscenter.com/koken/album ... ine-nr-31/

I'd like to get to http://www.c3iopscenter.com/koken/pages ... om-c3i-31/ by clicking on that top left album for Nr 31.

Thanks for your help!!

edit: Also, in this instance, is there a difference between inserting this into the Header vs Footer?
User avatar
Bjarne Varöystrand
Webbplatsadministratör
Webbplatsadministratör
Posts: 1063
Joined: Sun 29 Mar 2015, 21:02
Your name: Bjarne Varöystrand
Location: Lysekil, Sweden
Contact:

Re: Redirecting an Album to a Page  Topic is solved

Postby Bjarne Varöystrand » Mon 25 Jun 2018, 21:11

c3imagazineshop wrote:Source of the post I'd like to get to http://www.c3iopscenter.com/koken/pages ... om-c3i-31/ by clicking on that top left album for Nr 31.
This is not possible, not without rewriting big chunks of the core

Any solution you choose, has to be using JavaScript/jQuery or some redirect in the .htaccess; and by that executed when the original page is loading/loaded.

I made some small changes to the above JS, and if you want me to debug it; you need to have it in your page so I can test it out.

Code: Select all

<script>
   $(function() {
      if (location.href === '/koken/albums/album-contents/') {
         window.location.href = "http://www.example.com/koken/pages/page-contents/";
      }
   });
</script>
c3imagazineshop wrote:Source of the post Also, in this instance, is there a difference between inserting this into the Header vs Footer?
Since this "should" be executed as soon as possible, I would say it needs to be in the <head>, that way we don't need to wait on the page is fully loaded. :ugeek:
Regards
Bjarne Varöystrand - Image || Reddit || Twitter|| Facebook

Image
User avatar
trey
Donator
Donator
Posts: 12
Joined: Thu 14 Sep 2017, 06:28
Your name: trey

Re: Redirecting an Album to a Page

Postby trey » Thu 18 Jul 2019, 16:12

Hi Bjarne, I hope you're well.

I'm trying to do a similar thing wherein clicking the image on the front page of my website:

www.treypentecost.com

Does not go to the splash image album but instead to the street album.

I've put this into the header part of the HTML Injector:

<script>
   $(function() {
      if (location.href === '/koken/albums/splash-image/‘) {
         window.location.href = "http://www.treypentecost.com/albums/street/”;
      }
   });
</script>

But it does nothing and I know it's because I'm making some kind of simple mistake.

  • Similar Topics
    Replies
    Views
    Last post

Return to “Site Publishing”



Who is online

Users browsing this forum: No registered users and 1 guest