Drupal Views from Feeds - drupal-7

I have setup a feeds importer to grab news from another site. It has the built in block that's working just fine. Now I need to customize the output. How do I add more fields to the block? Tried with Views, which is kinda working, but it's not updating.
Anyone had any success making a view from the feed?

Have you already try to use the Agregator Module ?
I've already have a similar problem, just by "mix" Aggregator & Feeds modules and, works fine.
http://drupal.org/project/feeds > It provide a import/aggregate many supports as XML, RPC, OPML, CSV, ATOM and more ...

Related

How can I use DNNSharp MyTokens in 2SXC Razor templates?

I have a content type and C# Razor template for a simple page hero built using 2SXC. I also have a DNNSharp MyTokens with a simple token that looks like this: [DBQ:EligibleForExam]
Using the regular DNN HTML module, I can put my token in the source and it renders the value of the token.
I want to display the value of this DNNSharp MyToken inside of the C# Razor template but it doesn't show the value. Furthermore, I want to perform an if else statement on this value.
Here's what I want to do:
#if [DBQ:EligibleForExam] = 1 {
<p>You are eligible for the exam</p>
}
How can I use DNNSharp MyTokens in 2SXC?
In this case you can choose between going all the way 2sxc or all the way DNNSharp :
- scenario 2sxc: translate the DNNSharp token to 2SXC. I don't know what's behind that code but I guess it is some kind of SQL select and/or filters. In 2SXC you can create content types with SQL as a source. In the query designer, you can filter these results.
- scenario DDNSharp: in MyTokens you create a razorscript or HTML and make a token out of that. I don't think you hit any barriers soon following this path.
The core problem is that tokens are not well architected in DNN, there is no officialy "global" token system which knows about the DNN Sharp tokens.
I believe it should be easy to do though: I'm pretty sure there will be some documentation on DNN Sharp how to use their tokens in any c# or MVC page. Probably just 2-3 lines of code. So best check their docs.
2SXC does not render DNNSharp tokens like html module or EasyDNNSolutions do.
It would be an awesome thing as MyTokens and 2SXC are both very powerfull.
But maybe we can fix your problem within 2SXC itself or within DNN Sharp/HTML
What are you trying to accomplish? You can share the case / code here. Or if you feel this is beyond the Q&A setup that Stackoverflow is, you can send me an email.
Cheers
Tycho

2sxc - Getting URL path from DNN link parameter / Tab ID

I am working on integrating a 2sxc content WebAPI feed into a ReactJS application.
I have managed to get a JSON feed of data into the application, and am in the process of mapping out the data.
I'm wondering what the best practice would be to "resolve" a URL which is coming through as a DNN Page/ Tab ID.
Below I will showcase the various points this is referenced...
First the Setup of the entity / data types...
Then this is an example entry with the data filled out... The page link / URL is set up to point to another internal page on the DNN website:
Finally you can see this data item come through as a JSON feed via the 2sxc API:
What is the best way to convert this piece of data into a URL which can be used in a SPA type application?
There isn't any "server-side" code going on, just reading a JSON feed on the client side...
My initial idea would be to parse this piece of data in JS, to extract the number then use something like this:
http://www.dotnetnuke.com/tabid/85/default.aspx
http://www.dotnetnuke.com/default.aspx?tabid=85
I was hoping someone with more experience would be able to suggest a better / cleaner approach.
Thanks in advance
If you were server-side in Razor you'd be doing something like this:
#using DotNetNuke.Common
View List
XXXX = Dnn.Tab.TabID or define a string with the tab id you want
I seem to have a vague memory that I saw somewhere that Daniel (2sxc) has a way to use Globals.NavigateUrl() or similar on the client side, but I have no idea where or if I did see that.
The Default.aspx?tabid=xx format will certainly work, as it's the oldest DNN convention and is still used in fallbacks. The urls aren't nice, but it's ok.
The reason you're seeing this is because the query doesn't perform the automatic lookup with the AsDynamic(...) does for you. There is an endpoint to look them up, but they are not official, so they could change and therefor I don't want to suggest that you use them.
So if you really want a nicer url, you should either see if DNN has a REST API for this, or you could create a small own 2sxc-api endpoint (in the api folder) just to look that up, then using the NavigateURL. Would be cool if you shared your work.

What is the best way to update an angular application?

Our team is constantly working on an angular application, and every week or 2 we update it with new features or correct some bugs that came out.
We are using a C# backend with webservices.
QUESTION: When we update the application on the server, we sometimes (this doesn't happen all the time) get the problem that user is still seeing the old HTML and functionalities. What is the way to solve this?
I didn't find this on google, maybe I'm not looking for the right terms,
any help is appreciated.
Users have to clear their cache to get the new version of the application.
What you are seeing are cached copies of the JS files (possibly HTML partials too).
When the browser parses the HTML page, it makes the request for getting the JS resource and looks at various information before deciding to retrieve either the cached copy (if any) or whether to query the server again.
You can find some extra details on the Google fundamentals on HTTP caching
A solution I have been adopting myself is to set the cache headers to cache the file for a very long period, and then use tools in the build to version the file either on the filename or with a request parameter.
I have used grunt-cache-breaker and found it to serve well for this purpose. I know there is a gulp equivalent too
The most common way to make sure cached versions of your javascript aren't used is adding the version as a parameter in the reference to the script like so:
<script src="/app.js?v=v1.0"></script>

Loopback : How to get one model data from other mode service method?

I'm using loopback angular sdk I'm having two models Tags and Project. I want to get Tags related to that project. I'm having lb-services. I don't know what method to call and how to call it from services. please help. I've tried this code to get tags which is related to project who's id is 1.
Project.Tag.find(
{ id: 1 }
);
Here's an example from a live app ... For a relationship described like so:
https://github.com/ShoppinPal/warehouse/blob/490cbaccfb60922645173a34d53327629b989028/common/models/user-model.json#L28
I can pull the related models on the angular side like so:
https://github.com/ShoppinPal/warehouse/blob/dbf8d1e25592ec9e76d9f6a5f2af6ba6ca74fd9c/client/app/scripts/controllers/login.js#L57
If your problem is purely syntactical then please paste code from model.json file as well so the community can help detect & fix it.

DotNetNuke -- Inserting URL parameters in forms

We are migrating our website to DotNetNuke and are looking to replicate the functionality of our survey page. Currently, on the bottom of every e-mail we send through our CRM system, there is a link to a satisfaction survey along with some parameters to pre-populate some of the fields. So the URL looks something like like:
/survey.aspx?ticketID=1234&userName=John+Doe
I found the custom module "helferlein_Form" which seems okay for actually creating the form that the user fills in, but I don't see a way to pre-populate the fields. DotNetNuke does let you insert tokens(ex: [Date:now], [User:username]), but I don't see a way to grab individual parameters from the URL. Is there something I'm missing that will let me do that?
I'm not familiar with that module either, but I would strongly recommend using Xmod for customized forms that allow you to easily grab url parameters.
I'm not sure about the module you reference.
However, in my experience Dynamic Forms from Data Springs would fit the bill perfect. It has the ability to pre-fill and even run custom SQL queries to get data.
You should definitely try our My Tokens module.
It allows you to access the URL parameters using [Get:ticketID] or [QueryString:tickedID]. You can also build SQL tokens that use these parameters to return a list of items for example to populate a dropdown.
Also try our Action Form module which integrates very nice with My Tokens.
If you have a module you like and want to use you can always write a little javascript to grab the variables out of the URL and pre-populate your form fields using javascript.

Resources