# Can we have multiple content types with same fualias?

**URL:** <https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981>\
**Category:** support\
**Created:** [June 6, 2017, 3:04pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981 "2017-06-06T15:04:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tangerineinds](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/tangerineinds/32/803_2.png) [@tangerineinds](https://discourse.farcrycore.org/u/tangerineinds)\
**Post date:** [June 6, 2017, 3:04pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/1 "2017-06-06T15:04:58Z")

</div>

Is is possible to have multiple content types with the same / dir / friendly url?

IE

dmNews.cfc, dmBlog.cfc, dmOpinion all have fualias=“latest” generating the same “latest/” url structure.

Would that really make things wonky?

---

<div class="post-metadata">

**Author:** ![blair](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/blair/32/1179_2.png) [@blair](https://discourse.farcrycore.org/u/blair)\
**Post date:** [June 6, 2017, 9:14pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/2 "2017-06-06T21:14:05Z")

</div>

That will cause issues in a few places.

Blair

---

<div class="post-metadata">

**Author:** ![justincarter](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/justincarter/32/1213_2.png) [@justincarter](https://discourse.farcrycore.org/u/justincarter)\
**Post date:** [June 6, 2017, 11:50pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/3 "2017-06-06T23:50:36Z")

</div>

You can’t re-use the same `fualias` on multiple types (it needs to be unique so that the framework knows which content type to call the “type webskin” on when there is no friendly URL match found in the database), but you can generate any custom URL you like for your content types, and they can share the same URL stem.

So if you wanted your news, blog and opinion content types to all have URLs like;

```nohighlight
/latest/this-is-a-news-item
/latest/this-is-a-blog
/latest/this-is-an-opinion-piece

```

Then you can implement a `displaySystemFU.cfm` webskin for each of the content types;

```auto
<cfsetting enablecfoutputonly="true" showdebugoutput="false"> 

<!--- return the friendly url --->
<cfoutput>/latest/#stObj.label#</cfoutput>

<cfsetting enablecfoutputonly="false">

```

Note that the webskin is only outputting a single line. Spaces and other unallowed characters in the URL path will get converted by the framework automatically just as they would if you used them in a page title.

Here’s another example for a more complex custom friendly URL;

> <https://github.com/justincarter/farcry-plugin-blogfc/blob/master/webskin/blogPost/displaySystemFU.cfm>

---

<div class="post-metadata">

**Author:** ![tangerineinds](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/tangerineinds/32/803_2.png) [@tangerineinds](https://discourse.farcrycore.org/u/tangerineinds)\
**Post date:** [June 7, 2017, 12:10am UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/4 "2017-06-07T00:10:25Z")

</div>

This looks great @justincarter. So you would leave the fualias empty in the cfc correct? And drop in the fu display skin for each of the types you wanted to “override”?

---

<div class="post-metadata">

**Author:** ![justincarter](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/justincarter/32/1213_2.png) [@justincarter](https://discourse.farcrycore.org/u/justincarter)\
**Post date:** [June 7, 2017, 12:22am UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/5 "2017-06-07T00:22:13Z")

</div>

You could keep a unique `fualias` for each content type if you wanted to have a landing page for them separately (e.g. `/news`, `/blogs`, `/opinion`) but if you don’t need that then an empty `fualias` should be fine.

And yes, drop the friendly URL webskin into each type that you want to customise 🙂

---

<div class="post-metadata">

**Author:** ![tangerineinds](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/tangerineinds/32/803_2.png) [@tangerineinds](https://discourse.farcrycore.org/u/tangerineinds)\
**Post date:** [June 7, 2017, 6:00pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/6 "2017-06-07T18:00:32Z")

</div>

@justincarter one last question, I had experimented with the FUAlias decorator with no luck before posting this. I thought that would do what your `displaySystemFU.cfm` does to accomplish my need for multiple types of the same URL structure. Can you explain the FUAlias decorator?

**@@Fualias: friendly URL alias for the view**  
`Friendly URL alias is great. You can rename your view, as it appears in the URL, to just about anything you like. So for a view with a file name of displayRSSFeed.cfm you get a default URL containing "displayRSSFeed". Using fualias you could change this to simply "RSS".`

-via [http://blog.farcrycore.org/com.posterous.farcry/posts/2010/07/quick-summary-of-farcry-view-decorators.html](http://blog.farcrycore.org/com.posterous.farcry/posts/2010/07/quick-summary-of-farcry-view-decorators.html)

---

<div class="post-metadata">

**Author:** ![tangerineinds](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/tangerineinds/32/803_2.png) [@tangerineinds](https://discourse.farcrycore.org/u/tangerineinds)\
**Post date:** [June 7, 2017, 6:24pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/7 "2017-06-07T18:24:10Z")

</div>

> You could keep a unique fualias for each content type if you wanted to have a landing page for them separately (e.g. /news, /blogs, /opinion) but if you don’t need that then an empty fualias should be fine.

> And yes, drop the friendly URL webskin into each type that you want to customise 🙂

Just a note to those who are coming across this. You need to republish any published entries to get this to work. It actually overrides the URL at the DB level. So in my example of a content piece being published with `opinion/my-opinion-piece` I would need to drop in the skin to override, then republish and my opinion piece becomes `latest/my-opinion-piece`

Also of note, FC smartly archives the old url, so the old path 301’s (I assume) to its new path, but that old url will still render to the new url

---

<div class="post-metadata">

**Author:** ![justincarter](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/justincarter/32/1213_2.png) [@justincarter](https://discourse.farcrycore.org/u/justincarter)\
**Post date:** [June 7, 2017, 9:11pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/8 "2017-06-07T21:11:54Z")

</div>

The `@@fualias` decorator on a webskin allows you to give the webskin itself a friendly name, so that you can more easily refer to it in a URL or use getLink to look it up via the alias when generating a URL. It would be used for URLs like;

```auto
/news/rss
/news/this-is-a-news-item/preview

```

Where “rss” is the fualias for a displayTypeRSS webskin on news, or “preview” is the fualias for a displayPagePreview webskin on news which outputs a limited view of an article.

---

<div class="post-metadata">

**Author:** ![tangerineinds](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/tangerineinds/32/803_2.png) [@tangerineinds](https://discourse.farcrycore.org/u/tangerineinds)\
**Post date:** [June 14, 2017, 4:42pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/9 "2017-06-14T16:42:12Z")

</div>

This is complete, thanks for all the help

---

<div class="post-metadata">

**Author:** ![Phil\_Lepanto](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/phil_lepanto/32/1223_2.png) [@Phil\_Lepanto](https://discourse.farcrycore.org/u/Phil_Lepanto)\
**Post date:** [June 14, 2017, 5:11pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/10 "2017-06-14T17:11:26Z")

</div>

With regard to the issue of needing to republish entries… is there a way to trigger the modification programmatically? I have a lot of new URLs that suddenly need to be created.

---

<div class="post-metadata">

**Author:** ![justincarter](https://discourse.farcrycore.org/user_avatar/discourse.farcrycore.org/justincarter/32/1213_2.png) [@justincarter](https://discourse.farcrycore.org/u/justincarter)\
**Post date:** [June 14, 2017, 10:40pm UTC](https://discourse.farcrycore.org/t/can-we-have-multiple-content-types-with-same-fualias/981/11 "2017-06-14T22:40:45Z")

</div>

Yes, in the webtop under Admin → Developer Tools → Rebuild Friendly URLs, you can regenerate the system URL for the content types that you want to refresh. It should archive the old system URLs so that it redirects too.
