2sxc Blog App show year in URL of detail page - dotnetnuke

I'm using the default Blog App, by default the detail page url starts with /post/*
However, i also like the PublicationMoment Year to show as well in the URL. So for example if the post was published in year 2017 the detail page will have the year in the URL.
domain/blog/post/2017/post-url
example
http://2sxc.org/en/blog/post/2017/upgrading-to-2sxc-9-3-requires-2sxc-7
Any help would be really appreciated.

This is no problem at all. In the list view the link to the details is generated, ad you can basically add more stuff as you need it. DNN auto-converts pairs of values into request-variables, so
/post/xyz
is converted to
post=xyz
/post/2017/xyz
is converted to
post=2017 -> you don't want this!
/year/2017/post/xyz
converts to
year=2017
post=xyz
--> so this is probably what you want

Related

cakePHP Paginator::numbers() function does not include a page:1 parameter in the link for the first page

I have been trying to create a component like the Bakery's Paginator Recall that would allow me to save pagination data for CakePHP 2.4 and run into the following issue.
All solutions involve saving the Paginator parameters in the session and then retrieving and applying them upon returning to that same page without specifying any.
This approach would have worked if only the Paginator helper functions like numbers(), first() and previous() would include the page:1 named parameter in the links that they generate for moving to the first page like the corresponding function of the 1.3 version.
Unfortunately all of these functions create URLs without the page parameter when they refer to the first page, so when users click on the first page link, the component does not find any paging info and hence it returns them to the previous position.
There must be some way to work around this, but for the moment I am completely stuck.
NOT including the page number in the link to the first page is by design.
Read the reason on the CakePHP 2.4 Migration guide.
I would suggest to use the same convention. When you do not have pagination information assume is page one, and do not add it to your URLs.
So all you have to do is code this special case when then pagination is missing. And in this special case your "recall" component will simply not add that page.
I believe that I have managed to create a working solution. Thanks to the advice I have received I have now created a working component like the original PaginationRecallCompoent.
I have written all the details in the following blog post.

Drupal 7 displaying different user content

I have searched and searched and cannot find a solution to my specific problem...
I have a site that users join, and can upload their own videos. I crated a specific video type to handle this upload.
Other users can log in and see this content, they get to the content by clicking on a "profile" link for a specific user, and then it should display all the videos that user uploaded. Currently all I can get to work is display ALL of that content type, or none... I cannot figure out how to just get the user being looked for.
In my URL i have the user name being sent, because other info on the profile page that loads is driven off of that ( looked up in mysql tables and displayed with PHP).
As I mentioned I have a filter that limits to playervideo ( which is my content type) and that works, but as mentioned it displays all not just the user I am looking for.
any help would be much appreciated!!
thanks
I think your question is "How do I make a page for all users that lists content authored by a specific user"
I'd do this with the Views module.
Add a view for all your nodes.
Then add a "relationship" for "Content: Author".
Now add a "contextual filter" for the field "user: uid" with a default argument the userid from the URL.
Or you could try to add a contextual filter of "Content: User posted or commented" with the default value as the UID from the URL.
Cheers!

Edit content of a field from another Visualforce page on Salesforce

I am trying to create a custom lookup page on Salesforce: from a first Visualforce page, I open a second one in which there are a series of available choices; then I click on one of those choices and then I expect the latter page (the custom lookup) to close and the value of my choice to appear in the first page's lookup field.
I am unsure on this very last point: how do I make my choice appear in the earlier page?
As described in this awesome Jeff Douglas post you need to call function lookupPick2 in following manner
top.window.opener.lookupPick2('{!FormTag}','{!TextBox}_lkid','{!TextBox}','{!a.Id}','{!a.Name}', false);
Please read the entire post to get the full picture.
Where is LookupPick2 documented? When I google for it all I find is code examples and blog posts. Is there any documentation for it? I'll keep looking, but wherever it may be doesn't rank very high...

Drupal 7: Adding content/nodes from custom content type pages to another page

I'm working on a Drupal site an need to implement the following:
I have created an about us page template (page--about.tpl.php) and a custom content type for the about us page and linked the 2 using suggestions. I also have a custom content type for staff profiles that I need to add on the about us page in a tabbed format.
I can't seem to find a way to get the staff content to display in the about us page. I would ideally like it to render it the same manner as blog posts would display in a blog page.
So my question is, what code do I use to render all the nodes of the staff profiles content type in the about template page?
p.s I'm a bit of a Drupal noob, done a lot of reading but come up empty on this one.
If you already created content type About us (that is what i understood from mockup and explanation) then maybe you could use Views with EVA. That will enable you to have view as field in content type.
You can set it up with manage display or print it in template as all other fields. For example:
<?php print render($content['your_view_entity_view_1']); ?>
Other way would be to embed view in template. For example:
<?php print views_embed_view('your_view', 'block'); ?>
You can use the excellent Views module to create a block to list all your staffs.
Then you need to place the block that you had created with the help of view module in about-us page.
The Views module will give you suggestions to about which template to use.
EDIT: After the op provided the following image.
After you create a view to show all the Team member nodes you could simply print the view in your about us specific page template using following code.
$view = views_get_view('view name');
print $view->render('display_id');
Another option to do the same thing is, make blocks for all the content, viz. The Firm, The Team, Awards, Technonogly, Services and use quicktabs to display the content.
Yet another option to show a view as a field for a node is use EVA
Going the quicktabs way you can provide a lot of flexibility of showing teaser in about us page and leading to details about the same. For example each award can be a node in itself.

How do you display info from a database

I have figured out how to add data from a model into a grid like the examples on the learning section of the Agile Toolkit website. But I'm looking for the correct way to show data from a database without a grid.
Say I have a news database and I want to display it as a blog style news on my home page. Can someone point me to where to begin?
Trying to make this a little more clear:
I want to display data from multiple columns from a table news. So I would need to know how to get the title, date, author, content and then repeat that for say 5 latest news articles.
try this:
$this->add('View',null,null,array('view/mytemplate'))
->setModel('MyModel')
->loadData(123);
then inside templates/defaults/view/mytemplate.html
<div><h2><?$title?></h2>
<p><?$content?></p>
</div>
You can also use it with any view, even page.
$data=$model->get();
$page->template->set($data);
you can re-define template for your page by defining defaultTemplate function
function defaultTemplate(){
return array('page/mypage');
}

Resources