Problems, need help? Have a tip or advice? Post it here.
14 posts Page 2 of 2
Thanks KK.

I did this :

Code: Select all
<cms:capture into='my_contact'>
<cms:pages masterpage='contacts.php' page_title=_contact_dropdown limit='1'><cms:show k_page_id/></cms:pages>
</cms:capture>


Which works if I replace "_contact_dropdown" in "page_title" for the actual contact name.

Then, I updated the DB_PERSIST part to :

Code: Select all
 <cms:db_persist
                        _auto_title       = '1'
                        _invalidate_cache = '0'
                        _masterpage       = 'contrats.php'
                        _mode             = 'create'

                        contrat_status  = _contrat_status
                        block_evenement = my_repeatable
                        my_uid          = _my_uid
                        k_publish_date  = _k_page_date
                        contact_dropdown= my_contact
>


Still not working. If the code inside the "my_contact" capture sends the right data (the correct IDs), why can't the system find the right contact?

I tried entering "2506" instead of "my_contact" for the "contact_dropdown" line in the DB_PERSIST part, and it worked. The relation field was populated with the right contact within that contract.

I tried
Code: Select all
contact_dropdown= "<cms:show my_contact/>"

and
Code: Select all
contact_dropdown= "my_contact"


Not working. Thanks a lot KK, I think we are getting close to fixing this issue for me.
Again, as I suggested before, work in small steps.
Before using the fetched data, you need to make sure if the code is indeed finding the correct data.
What does the following show? -
Code: Select all
<cms:pages masterpage='contacts.php' page_title=_contact_dropdown limit='1'><cms:dump/></cms:pages>

Does it get the correct page from contacts.php? If not, see if there is indeed a page with the matching title in contacts.

If the code above works, place it within <cms:capture> and output only the k_page_id. See what is getting captured by placing a <cms:show my_contact />. If it shows the correct ID, your cms:db_persist code should work.

I somehow suspect (I might well be wrong) that the contacts.php template does not have pages matching the value fetched from the CSV.
It worked!

Thank you so much KK.

Final code is :

Code: Select all
<cms:capture into='my_contact'>
<cms:pages masterpage='contacts.php' page_title=_contact_dropdown limit='1'><cms:show k_page_id/></cms:pages>
</cms:capture>


_contact_dropdown being the name of the column in the CSV.

And then in the db_persist section :

Code: Select all
<cms:db_persist
                        _auto_title       = '1'
                        _invalidate_cache = '0'
                        _masterpage       = 'contrats.php'
                        _mode             = 'create'

                        contact_dropdown= "<cms:show my_contact/>"
>


Thank you very much for your help. I really appreciate you took the time to explain the steps to making it work.
Hopefully this will help others with the same situation in the futur.

Have a great day
Hello,

I am using relation in the gallery to upload photos to my blog.
And I have a problem, I need to import data and images to my blog, is that possible?

Thanks!

Code: Select all
 <cms:capture into='my_photo'>
    <cms:pages masterpage='products-img.php' gg_image=_product_photos limit='1'>
        <cms:show gg_image/>
    </cms:pages>
    </cms:capture>
            <cms:if my_page_id=''>
                    <cms:db_persist
                        _auto_title       = '0'
                        _invalidate_cache = '0'
                        _masterpage       = 'danh-muc-san-pham.php'
                        _mode             = 'create'
                       
                        k_page_title      = my_page_title
                        k_page_folder_id  = folder_id

--------
product_photos = "<cms:show my_photo/>"
---------
14 posts Page 2 of 2
cron