Skip Navigation

[Resolved] Displaying view with CRED links in Admin Dashboard

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.

Tagged: 

This topic contains 14 replies, has 2 voices.

Last updated by Joff 7 years, 10 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#102648

Hi,

I've added the Views CSS inside my customised admin dashboard and rendered a view, but the CRED shortcode generated inside the view doesn't resolve to a link.

Is there a file I have forgotten to include in the head?

Cheers

Joff

#102649

I already added the following inside the admin head

<link rel='stylesheet' id='foundation-css-css' href='hidden link' type='text/css' media='all' />

Cheers

#102652

I've now added...

<script src="hidden link.......com/wp-content/themes/required-foundation/javascripts/foundation.min.js"></script>
<script src="hidden link......com/wp-content/themes/required-foundation/javascripts/required-foundation.min.js"></script>
<script src="hidden link.......com/wp-content/themes/required-foundation/javascripts/theme.js"></script>
<script src="hidden link.......com/wp-content/themes/required-foundation/javascripts/app.js"></script>

<script src="hidden link.......com/wp-content/themes/required-foundation/javascripts/jquery.foundation.tabs.js"></script>

<link rel='stylesheet' id='foundation-css-css' href='hidden link.......com/wp-content/themes/required-foundation/stylesheets/foundation.min.css?ver=3.2.5' type='text/css' media='all' />

But still no CRED link 🙁

#102664

Also, types shortcodes also don't resolve :'(

#102806

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi Joff,

CRED is designed for wordpress front-end, so CRED shortcode do not work in admin side.
But you can try create a CRED edit link for it.

1) create a CRED form which can edit post content
2) modify the link in your view, append cred-edit-form=ID in it,

For example, if your current post link is hidden link, and CRED from post ID is 123
you can change it like this: hidden link

#103012

Thanks for your response Luoy.

Your link works, but then I thought it would be more logical (as the user is on the admin dashboard at the time, that the link went to the post edit screen, so I used the post ID as follows an ignored the CRED form (although will be building a front end dashboard soon so your advice is greatly appreciated)

<a href="hidden link">Edit</a>

One last thing, I do need the types field shortcode to resolve, so was wondering if there was a way I could call the types field within a view for the admin dashboard?

Thanks again

#103045

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Types shortcodes should works in WP admin side, could you describe detail steps to duplicate same problem?

#103101

Hi Luoy,

I have created a normal view with the following code

[wpv-layout-start]
[wpv-posts-found]
<!-- wpv-loop-start -->

    <wpv-loop>

  • [wpv-post-link] | [types field="date-time"][/types]
  • </wpv-loop>

<!-- wpv-loop-end -->
[/wpv-posts-found]
[wpv-no-posts-found][wpml-string context="wpv-views"]No posts found[/wpml-string][/wpv-no-posts-found]
[wpv-layout-end]

The page output ends up being

2 | [types field="date-time"][/types]
1 | [types field="date-time"][/types]

Regards

#103104

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

How do you out put this view in admin side?

#103110

A php file calls the following code

<?php echo render_view(array('title' => 'Dashboard Sessions')); ?>

Thanks

#103971

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for your feed back, I have duplicate same problem in my localhost, and put it into our to-do list. currently please try use Views shortcode [wpv-post-field] instead:
https://toolset.com/documentation/views-shortcodes/#wpv-post-field

#103978

Thanks Luoy,

I added the field, which is a date field, but it is not rendering in a date format, just a 10 digit integer.

I then added the 'format' variable as per wpv-post-date but still get the decimal output.

Can you please advise?

Thanks

Joff

#103980

Just to explain - I used the following

[wpv-post-field name="wpcf-date-time" format="F jS, Y"]

#104437

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Please try create a custom shortcode for it like this:
1) add codes in your theme/functions.php

add_shortcode('my-date-time', 'my_date_time_func');
function my_date_time_func()
{
$timestamp = get_post_meta(get_the_ID(), 'wpcf-date-time', true);
return date_i18n( 'F jS, Y', $timestamp );
}

2) modify your shortcode as this:
[my-date-time]

More help: http://codex.wordpress.org/Function_Reference/date_i18n

#104450

Thanks Luoy,

That worked.

Cheers for your help!