Skip Navigation

[Resolved] Split: Content Template issues when editing posts

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by nedG 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#609722
609539-View_Edit_Button.jpg
609539-Edit_Music_Gig_Page_Not_Working.jpg
609539-CRED_User_logged_in_page_1.jpg
609539-CRED_Insert_edit_post_link.jpg

Hi Nigel,

Thank you for looking into the [toolset-edit-post-link...] shortcode issue

I will try to explain in more detail the issues I am seeing with the second part of my problem.

Here is the process that I have undergone...

1) When a user logs in they end up on this page... hidden link
2) This page is simply assigned to a Content Template called PAGE TEMPLATE - CRED - User Admin Home Page
3) It is a simple 2-column layout with a sidebar menu on the left (which is simply another Content Template called...." CRED - Left Sidebar User Menu)" and a main BODY shortcode on the right [wpv-post-body view_template="None"]
4) You can see this simple layout in the screenshot provided.... "CRED-User-logged-in-page.jpg"
5) This is a nice, desirable layout so I wanted users to see a very similar layout whenever they were going to EDIT one of their Music gigs
6) So I duplicated the Content Template mentioned above and I created a new Content Template called... "PAGE TEMPLATE - CRED - Edit Music Gig"
7) This new Content Template has the same sidebar menu on the left... but obviously since it is going to be for CRED forms, I couldn't leave the BODY shortcode onthe right side... so I replaced the page BODY shortcode with the Shortcode for the CRED form that allows users to Edit their Music Gigs. That CRED form is called.... "Edit a Music Gig (By User)". So the shortcode on the right side is... [cred_form form="edit-a-music-gig-by-user"]
8) This is all per your documentation on this page... https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/
9) So then I went and created the View to display all of the Music Gigs. This View is called... "CRED - Users Music Gigs (UPCOMING)"
10) Inside that View on line 43 I did the following....
a) Clicked the "Fields and Views" button
b) Clicked the "CRED Editing" link
c) Clicked the "CRED edit-post link" button
d) Selected the "PAGE TEMPLATE - CRED - Edit Music Gig" Content Template from the selection Menu (see screenshot "CRED-Insert-edit-post-link.jpg")
e) Clicked the "Insert Shortcode" button
f) That created the shortcode... [toolset-edit-post-link content_template_slug="page-template-cred-edit-music-gig" class="btn btn-warning btn-xs" style="font-size: 11px; padding:2px 5px; line-height:1; margin:2px 0 0 0;"]Edit[/toolset-edit-post-link]
11) This is the shortcode that produces the EDIT button on the user's list of Music Gigs ( see screenshot ... "View-Edit-Button.jpg")

So far so good... Then the problems start....

12) That "Edit" button doesn't seem to appear for DRAFTS (that is the initial problem that started this ticket. You alredy recognize this issue).
13) The other problem occurs when the user clicks on any of the EDIT buttons for any of the existing Music Gigs.
14) The user is taken the the appropriate Content Template.... "PAGE TEMPLATE - CRED - Edit Music Gig"
15) However, when the page appears there are several problems
a) The left sidebar is missing
and
b) None of the Javascript is working on the right side (see the screenshot....Edit-Music-Gig-Page-Not-Working.jpg)

So that is basically the steps needed to be able to reproduce my issue.

Now.... just so you can see the difference.....
If you go back the View called.... "CRED - Users Music Gigs (UPCOMING)" and go to line 43 and comment it out.... and then uncomment line 45 and use the [cred_link_form...] shortcode, you will get an EDIT link that directs you to a workable page and allows users to edit their Music Gigs and all of the JS works... but the layout is terrible.

I am seeking a good layout for all of this.

Where have I gone wrong?

#610159

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ned

Sorry for the delay getting back to you, it took a while to work through everything on your site and then try and reproduce it on a clean local test site—which I was able to.

That means I'm able to escalate it so that it can be investigated further by second tier and our developers.

I'll get back to you as soon as I hear back from them.

#610161

No Problem Nigel. Thanks for the continued support. 🙂

#611878

Nigel,

Is there any progress on this matter?

#612201

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ned

The issue has been confirmed in second tier—basically you cannot have two content templates on the same page if one of them contains a CRED edit form and you link to that page with the cred edit post link shortcode—and passed up to the developers.

I know they are currently prioritising the imminent update to the Types and Views post relationship betas (with support for CRED and WPML) and should hopefully get to this then.

As a workaround in the meantime, it's not ideal but you can copy and paste the markup from the template you use for the sidebar and insert it directly.

#612265

Hi Nigel,

But that isn't the only problem. not displaying the "sidebar" Content template was certainly an issue but more importantly.. the javascripot isn't working when i use the [toolset-edit-post-link...] shortcode instead of the [cred_link_form...] shortcode.

Here is a simple test to see my problem.

1) Go to the MY BEACH LOGIN PAGE..... hidden link (use the login information provided previously)
2) Login In and go to My Music Gigs
3) If you don't have any Music Gigs listed, go ahead and create one
4) Then go back to the My Music Gigs page and click the Edit button next to the Music Gig you created. This Edit button uses the [toolset-edit-post-link...] shortcode
5) The page appears (with the exception of the Content Template issue that we discussed above).... however the other BIG issue is that the Javascrip on that page isn't loading or working properly

In order to see how the Javascrip is supposed to look, do the following

1) Go to the MY BEACH LOGIN PAGE..... hidden link (use the login information provided previously)
2) Login In and go to My Music Gigs
3) Click on the PAST MUSIC GIGS tab
4) hopefully you can see a past Music Gig listed there. If not, we will have to create a music gig and simply put the start/end dates in the past.
5) NOTE: The Edit button in this list/View doesn't use the [toolset-edit-post-link...] shortcode. I haven't updated the code intaht View yet.. so taht Edit button is still generated by the [cred_link_form...] shortcode.
6) Click the Edit button next to the Past Music Gig. Remember, this Edit button uses the [cred_link_form...] shortcode.
5) The page appears and all of the Javascript is working properly. Click aronud on the radio buttons and you will see what I mean. Becasue it is functioning properly, I could simply use the [cred_link_form...] shortcode but unfortunately it doesn't have a very appealing layout. There is no way to wrap this in a Content template. That is why I switched to the [toolset-edit-post-link...] shortcode

Do you see my problem?

#613775

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ned

Sorry Ned, I missed the notification about this. (I just suggested a change to our internal workflow to make that less likely.)

The JavaScript in question, it is the JavaScript that is in the form itself, is that right?

If I edit the form "Edit a Music Gig (By User)" I see that it has quite a bit of code in the custom JS section.

Is this the code you are referring to?

If I edit a past gig (the cred-link-form method) and check the source code for the loaded page I can see that custom JS printed there.

If I edit an upcoming gig (the toolset-edit-post-link method) and check the source code I can still see the same JS printed.

So the JS is present.

Or did you mean some other code?

#613956

Hi Nigel,

For some reason it seems to be working now. The Javascript seems to be fully functinal now for both versions of the "Edit" link.
[cred_link_form...] shortcode
and the
[toolset-edit-post-link...] shortcode.

Hmmmm. weird.

Not sure what happened.