Hello!
I have 2 questions.
First, is there a way to make sure the content of a specific field is unique in the database?
I know that users need unique emails for example.
But for regular entries using clonable pages, it is possible to do something like this?:
I know "unique_field" doesn't exist, but is there anything that would act abit like this?
The reason I would need this, is that there's a "Contact list" clonable pages section, and mulitple users can edit contacts, or add some in the admin panel. But it is important to make sure that no one adds a contact that already exist. And since there's going to be hundreds of contacts, the way to verify if it exists would be to check if the "contact_email" region content would already be saved in another entry. If it does, it should display a message that would say that it is not possible to save this entry with the content in the actual email region because it already exists.
2nd question is, is that possible to display entries from specific pages (clonable pages), from the logged in user only?
What I did right now is adding a dropdown region for each clonable pages, with each usernames as options, and when you create an entry, you have to select your username. Then, I activated a custom admin theme, and edited the "content_list_inner.html" file, for my specific page, and changed the <cms:pages...> part of the code for this :
I have added a condition that checks if the current username is "john-doe", and if it is, I changed the "custom_field option for the masterpage to show only the ones where John Doe is selected in that dropdown region I talked about earlier. Thing is, I am using filters too with the addon available on the forum. Since I'm changing the custom_field value from "k_selected_custom_field" to "'author=John Doe'", I cannot user the filters, and I really need to be able to use filters.
Any solutions that would solve my issue?
Thanks a lot!
I have 2 questions.
First, is there a way to make sure the content of a specific field is unique in the database?
I know that users need unique emails for example.
But for regular entries using clonable pages, it is possible to do something like this?:
- Code: Select all
<cms:editable name='contact_email' label="Email" type='text' unique_field='1' />
I know "unique_field" doesn't exist, but is there anything that would act abit like this?
The reason I would need this, is that there's a "Contact list" clonable pages section, and mulitple users can edit contacts, or add some in the admin panel. But it is important to make sure that no one adds a contact that already exist. And since there's going to be hundreds of contacts, the way to verify if it exists would be to check if the "contact_email" region content would already be saved in another entry. If it does, it should display a message that would say that it is not possible to save this entry with the content in the actual email region because it already exists.
2nd question is, is that possible to display entries from specific pages (clonable pages), from the logged in user only?
What I did right now is adding a dropdown region for each clonable pages, with each usernames as options, and when you create an entry, you have to select your username. Then, I activated a custom admin theme, and edited the "content_list_inner.html" file, for my specific page, and changed the <cms:pages...> part of the code for this :
- Code: Select all
<cms:if k_user_name == "john-doe"> <cms:pages masterpage = k_template_name id = k_selected_pageids folder = k_selected_foldername orderby = k_selected_orderby order = k_selected_order custom_field = 'author=John Doe' paginate = '1' limit = k_selected_limit show_unpublished = '1' show_future_entries = '1' page_name = "<cms:if k_selected_exclude>NOT <cms:show k_selected_exclude /></cms:if>" start_on = k_selected_start_on stop_before = k_selected_stop_before base_link = k_route_link token = k_cur_token > ...
I have added a condition that checks if the current username is "john-doe", and if it is, I changed the "custom_field option for the masterpage to show only the ones where John Doe is selected in that dropdown region I talked about earlier. Thing is, I am using filters too with the addon available on the forum. Since I'm changing the custom_field value from "k_selected_custom_field" to "'author=John Doe'", I cannot user the filters, and I really need to be able to use filters.
Any solutions that would solve my issue?
Thanks a lot!