How to use two directories in the same project?

Hi community,

I’m working on a project that has two templates Providers and Locations, do you know which is the best way to create these directories? If they are using for example the same entity type Root. I’d like to have in my production environment locations.domain.com/root.html and providers.domain.com/root.html but rn is not working because the project said that it is not possible to run two pages with the same slug, so is there a way to achieve this? FYI I’m using React.

Adding another question, is it possible that the Directory Manager creates entities filtered by a field? For example if test_field is No the directory is not gonna create the entity for that page.

Let me know if that info was clear and appreciate your help!

Hello @Joseph_Valenciano,

What I am understanding is you are using 2 different templates for one entity (slug) to display the relevant data accordingly. (let me know if the case is something else. :slight_smile: ) will try to look in that direction and help accordingly. )

If that’s the case, then the same “Slug” field should not be used for 2 different templates and can consider any solution mentioned below:

Solution 01. You can have different entities where you can use independent “slug” values using unique identification for each template.

Example:

Since you will be using separate entity for template, you will be able to manage the content independently for each template which you will not be able to by using single entity for both templates.

Solution 02. if the content would be same for both templates then you can add another field (for example: Slug_providers) by that you will be able to use independent “slug” field separately for each template so the value accordingly.

Hope it helps.!

Thanks for your response @Tosh_B! Appreciate it!

So, just to put you in context - Basically, I’m migrating an old Yext project to a new one with React. The thing is the old one was built with classic pages in two different projects. You can see the below image.

In that case, there’s no problem to use for example locations.domain.com/index.html and providers.domain.com/index.html, is it impossible to achieve that in just one Yext Pages project?

Hi @Joseph_Valenciano

Thank you for sharing the context here since it provided more clarity.

Looks like it can be achieved via introducing independent directory page for each entity type i.e. “Location” data and “Providers” profile data

Example:

Location Directory Page
www.abc.com/location-directory

Providers Directory Page
www.abc.com/providers_directory

You would be needed to run/process 2 different directories for each entity type i.e. “Location” and “Providers”. Within Providers Entity Type, a “Slug” field would be there already which has been used in current classic pages implementation for directory implementation.

Since the URL structure would be update with the new implementation, I believe you already have considered the existing URL indexing which would not be sustain on the new URL structure and redirection will take place to the appropriate page’s new URLs.

Hope it could help.