Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.1.7, getAddedBy, getEditedBy, getFormattedTimeStamp, premalink
- This topic has 8 replies, 2 voices, and was last updated 8 years, 7 months ago by
Sam Chadwick.
-
AuthorPosts
-
02/19/2015 at 11:31 am #319986
Sam Chadwick
ParticipantSteve,
I tried to build my own function based on the class.entry-output to display “Added By”, “Edit By” and “Last Updated”. However I appear to be unsuccessful. I also took a look at getRevisionBlock, but that returned blank when used within the cMap card-single template.
Can you assist with whether there is a function already for this, and if not, what it would be?
Many thanks,
Sam02/20/2015 at 9:39 am #320059Steven Zahm
Keymaster@ Sam
re: I also took a look at getRevisionBlock, but that returned blank when used within the cMap card-single template.
You need to use it like this:
`getRevisionDateBlock(); ?>I never updated it to echo by default, which it should.
re: I tried to build my own function based on the class.entry-output to display “Added By”, “Edit By” and “Last Updated”.
You can pull the code from the Connections : Manage admin page:
echo '<span style="display: block;"><strong>' . __( 'Added By', 'connections' ) . ':</strong> ' . $entry->getAddedBy() . '</span>'; echo '<strong>' . __( 'Edit By', 'connections' ) . ':</strong> ' . $entry->getEditedBy(); echo '<strong>' . __( 'Last Updated', 'connections' ) . ':</strong> ' . $entry->getFormattedTimeStamp( 'm/d/Y g:ia' );
These are basically straight copy/pastes so they should work just fine once plunked down into their own functions.
Hope that helps!
02/20/2015 at 9:55 am #320061Sam Chadwick
ParticipantPerfect!
02/20/2015 at 6:55 pm #320124Steven Zahm
Keymaster@ Sam
Great to hear!
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections02/23/2015 at 10:13 am #320409Sam Chadwick
ParticipantSteve,
How can I make the categories hyperlinks to search results (in the same way that WordPress posts do)?
Thanks,
Sam02/24/2015 at 10:18 am #320567Steven Zahm
Keymaster@ Sam
Sorry, not easily doable until I release 8.2. There’s a brand new function I added specifically to do this. But if you want to give it go any way…
You would need to edit these two line:
- https://github.com/Connections-Business-Directory/Connections/blob/feature/term-meta/includes/entry/class.entry-output.php#L2467
- https://github.com/Connections-Business-Directory/Connections/blob/feature/term-meta/includes/entry/class.entry-output.php#L2475
You would replace the contents of the
li
andspan
tags with a call to this function:But since that function does not exist in the released version of Connections, you’ll have to create your own custom version of the function and call it instead.
Hope that helps!
02/25/2015 at 5:55 am #320660Sam Chadwick
ParticipantSteven,
I added the following at #L2467 and then a similar version but with the different $.out at #L2475. The permalinks appear, however the link destinations are incorrect.
Using the category search within the cMap template, the URL returned is:
http://myurl.com/?page_id=890&cn-s=&cn-cat%5B%5D=862
which works correctly, as I implemented your suggestion to enable multiple categories to be selected http://connections-pro.com/support/topic/customization-enhancements/Using the code below, the category permalink returns: http://myurl.com/category/862/ which loads the Connections page correctly, and has the correct category in the search box, but “No results found”.
Looking at the other permalinks, e.g. http://myurl.com/locality/London/ I saw that the term itself is used rather than the term_id so I tried:
‘slug’ => $category->name
But this put every category in the system in the search box (and therefore returned everything).
I did check for conflicts in the permalinks settings. Connections uses ‘category’ and WordPress uses ‘cat’.
Any suggestions?
foreach ( $categories as $category ) { $this_category = cnURL::permalink( array( 'type' => 'category', 'slug' => $category->term_id, 'title' => $category->name, 'text' => $category->name, 'home_id' => $this->directoryHome['page_id'], 'force_home' => $this->directoryHome['force_home'], 'return' => TRUE ) ); $out .= '<li class="cn_category" id="cn_category_' . $category->term_id . '">' . $this_category . ''; }
02/25/2015 at 8:54 am #320685Steven Zahm
Keymaster@ Sam You want to use:
'slug' => $category->slug,
This should work, but it will not add the ancestor category slugs to the permalink. As an example, consider this category struct:- Parent
-
- Child
-
- Grandchild
The struct should be
/parent/child/grandchild/
This code will only get you,
/grandchild/
Like I said, it should work since Connections only queries the category at the end of the struct but technically the permalink will be incorrect. Hope that makes sense.02/25/2015 at 9:22 am #320693Sam Chadwick
ParticipantThe search results are now correct but the page loads with every category available as being selected rather than just the one related to the permalink.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.