|
I figured it out. I ended up doing this in _Layout.cshtml:
$('#fluidHeader').load('@Url.Action("LargeHeader","Home")');
and this in the Home controller:
public ActionResult LargeHeader()
{
return PartialView("_LargeHeader");
}
Which displays the appropriate markup.
However, I want to use data from a model in the _LargeHeader partial view, and ran into my next roadblock. I started a new question for that.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Hi, everyone!
I scrolled internet and find some interesting article about blockchain. I see that this trend is getting more popular with everyday. But the main question, how to start development in that industry? I am a backend specialist. What info or sites you can recommend to learn this technology and what I'll need to know to work with it? Just for a start and so on.
Thank you!
|
|
|
|
|
You can get started with the Wikipedia article as a free resource, Blockchain - Wikipedia.
For any trusted resource, you can find a good resource (book, video course etc.) from a publisher. Since this is an emerging technology, many publishers are investing in the technology and providing an expert-led tutorial that you can look for. Then, there are these libraries (frameworks/platforms) that you can study and learn how they work.
Other resources include, Tutorials & Guides Archives - Blockchain Blog
What is blockchain? - IBM Blockchain
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
What do you guys use?
A lot of people use reCaptcha (millions of sites according to their propaganda). My only concern there is that if someone succeeds in hacking their stuff, MILLIONS of sites become vulnerable at the same time. Is that a pointless concern?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Certificate-based auth so CAPTCHA isn't needed?
But seriously, it's just a key code generated off of a selection grid. As long as you limit attempts from a single source (which I'm positive reCAPTCHA does) and seed the interaction (also something it does) it should be as secure as you're going to get in an ostensibly untrusted interaction.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I have created a custom module and trying to override model in Magento 2. I am following all the steps mentioned in the tutorial Learn How to Override Model in Magento 2[^] but still i am having error. This is the code
<?php
namespace Magenticians\Moduleproduct\Model\Catalog;
class Product extends \Magento\Catalog\Model\Product
{
public function getName()
{
return $this->_getData(self::NAME) . ' + Demo Text';
}
public function getSku()
{
return "123-Demo";
}
}
|
|
|
|
|
Message Removed
modified 5-Jan-18 14:07pm.
|
|
|
|
|
Message Removed
modified 5-Jan-18 14:07pm.
|
|
|
|
|
Sorry if this is not the correct forum for discussions on Swagger but I don't know which one is appropriate for it.
I have a rest web api created in C# which returns a JSON response containing base objects and their derived objects. In Swagger response body I am able to see both the base objects and derived objects after applying the filters as explained in the post How do I include subclasses in Swagger API documentation using Swashbuckle? - Stack Overflow[^]
However, I only see the base objects in the Example Values and not their derived objects. So suppose my JSON contains objects called Dog and Cat which inherit from the Animal object, then only the Animal object will show up in the Example Value but not the Dog or Cat object.
Please show me how to modify Swagger Example Value to display base objects and their derived objects. Thanks.
|
|
|
|
|
You could always ask the person who wrote the StackOverflow answer.
|
|
|
|
|
Kindly elaborate more on what exactly you want to modify in Swagger
|
|
|
|
|
ok, this is possibly an unusual one...
I have a friend who owns a load of domain names, which he's always had the intention of setting up with full blown sites over time
he isn't a coder, but he is a really good ideas guy
Obviously, this means he is paying a load of money out each year for renewals, way too much, thousands!
At one point he had close to 3000 names, i think many lapsed but he still has at least a few hundred, maybe even a 1000!
So anyway, the here task is to find a way to put some kind of sites up really quickly, with the intention of making a small amounts of money from advertising, not so that he can make a fortune from them, but just so that each one can cover the renewal fee.
he wants to get some of the full sites developed as soon as possible but obviously can't do them all at the same time.
Therefore, As these quick sites are built, he wants to be able to make a bit of money off each to cover the domain renewal cost, and use that money (which was being used to renew) to have the full ones built and gradually snowball the development of the portfolio
so for the initial phase, i think the priorities are to look at having a fast, efficient way of getting sites online, being able to automate everything possible.
I know him well and he is not a spamming kind of person, but he needs to stop the outgoings and put that money into developing the full sites
his initial ideas (for the full sites) were good and in depth for each site.
Some related domains were to be used to point to 1 central site, like several satellites generating traffic for the main one in each area
he says as long as they are making the renewals then thats good enough at this stage
oh, and he hates Wordpress, so anything WP related is off limits
My skillset and preferences revolve mainly around Laravel, but I'm open to other non-Laravel solutions if thats what would be a better fit
so far, I'm thinking towards the following possibilities, but I'm open to critique on any of them, since I do not have the experience to tell what would work best
- to find a way to create a fairly simple template and find a system to be able to upload multiple versions of it quickly.
- I was interested in finding out more about laravel.hosting as they said they had a 1-click Laravel solution, but now I'm not sure if they would be the best people to use!
- Maybe Forge could be a possible solution for quick deployment?
- could I use subdomains running from one laravel base for this? I don't know if that is possible
- use sass with variables for the colours, and on each iteration, have a different sass variables file which would give a different colour theme on each site.
- research scraping to find a way to include content on each site. I've found possible solutions in Python, Rails, and a possible solution in Laravel by writing a scheduled command
- group the domains into subject areas, so that different content can be added to one site, and then point related domain names at the one with the content
- have (google or other) ads included to create Click Through income
Any ideas?
|
|
|
|
|
I find it a bit suspicious that someone would accumulate thousands of sites without having any use for them. What's missing from your description is just what kind of site(s) he needs to set up. And why so many domains?
It sounds like someone who is going to get themselves in lots of search engines with all of the sites pointing the same one (or few). This way, if a scammer, he/she can get lots of hits and still keep an apparently good reputation via the many other sites.
Perhaps follow up with a plausible and legitimate reason for this scenario and you'll get more help.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I want to disable add to cart button for specific products. Can anyone guide me on this ?
|
|
|
|
|
Where does this cart come from?
WordPress? ASP.NET based, or any other? You need to share some more specifics about it.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
You need to create a custom module to implement it.
After the creation of module, create the InstallData.php file in app/code/Magenticians/Mymodule/Setup and add the following code in it:
eavSetupFactory = $eavSetupFactory;
$this->attributeSetFactory = $attributeSetFactory;
$this->categorySetupFactory = $categorySetupFactory;
}
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
// CREATE ATTRIBUTE SET
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
$attributeSet = $this->attributeSetFactory->create();
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
$attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
$data = [
'attribute_set_name' => 'DisableAddToCart',
'entity_type_id' => $entityTypeId,
'sort_order' => 200,
];
$attributeSet->setData($data);
$attributeSet->validate();
$attributeSet->save();
$attributeSet->initFromSkeleton($attributeSetId);
$attributeSet->save();
// CREATE PRODUCT ATTRIBUTE
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'text_add_to_cart',
[
'type' => 'varchar',
'label' => 'Add to Cart Text',
'backend' => '',
'input' => 'text',
'wysiwyg_enabled' => false,
'source' => '',
'required' => false,
'sort_order' => 5,
'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE,
'used_in_product_listing' => true,
'visible_on_front' => fasle,
'attribute_set' => 'DisableAddToCart',
]
);
$setup->endSetup();
}
} ?>
Now based on the above attribute you can disable your overridden add to cart file.
Complete Guide: Magento 2 Disable Add to Cart Button for Certain Products
|
|
|
|
|
I'm trying to use the bootstrap carousel (using the sample code from the bootstrap web site), and it's displaying all of the images at the same time. What am I doing wrong? ([Image data] indicates the base64 text where the image is being specified - I left the actual data out in the interest of brevity.)
<div class="row">
<div class="col-md-12">
<div id="ttpImageCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" src="data:image/jpg;base64,[image data]" alt="" />
<div class="carousel-caption d-none d-md-block">
<span style="display:inline-block;">Image 1 of 4</span>
</div>
</div>
<div class="carousel-item">[image 2 of 4]</div>
<div class="carousel-item">[image 3 of 4]</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="data:image/jpg;base64,[image data]" alt="" />
<div class="carousel-caption d-none d-md-block">
<span style="display:inline-block;">Image 4 of 4</span>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
Previous
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
Next
</a>
</div>
</div>
</div>
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I fixed it. I'm using bootstrap3 and the sample I used was for bootstrap 4 (although it didn't call out v4 anyplace in the sample).
I also found out that I had to include the following in my web config to avoid 404 errors in the javascript when searching for fonts that font-awesome needed:
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/x-woff" />
</staticContent>
</system.webServer>
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You might need more MIME mappings for the other font types:
<mimeMap fileExtension="eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension="otf" mimeType="application/x-font-opentype" />
<mimeMap fileExtension="svg" mimeType="image/svg+xml" />
<mimeMap fileExtension="ttf" mimeType="application/x-font-truetype" />
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff2" />
According to this SO thread[^], the official MIME type for Woff2 might have been changed to font/woff2 ; but application/font-woff2 works for now.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for the heads up.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I have started with creating a custom module as mentioned in this tutorial Learn How to Override Block in Magento 2[^] that editing the core files can be a risk so i have created my own custom module but still i am facing problems i don't know what's wrong with the code.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magenticians_Modulecontact" setup_version="1.0.1">
|
|
|
|
|
Hi
Anyone can help me out in this issue.My coordinate are fetching latitude and longitude from database dynamically and that should display as marker everytime when database updates by serial number but it is not displaying.
view:
<?php echo $map['javascript'];?>
<?php echo $map['mapdiv']
model:
function googlemaps($serial)
{
$return=array();
$query=$this->db->select('cycle_serial,cycle_19_INT,cycle_20_INT,cycle_21_INT,cycle_22_INT,cycle_23_INT,cycle_24_INT')->from('cycles')->where(array('cycle_serial'=>$serial))->limit(1)->order_by('cycle_timestamp','DESC')->get();
if($query->num_rows()>0)
{
foreach($query->result_array() as $row)
{
array_push($return,$row);
}
}
return $return;
}
controller:
function Googlemaps($serial)
{
$this->load->library('googlemaps');
$config['minifyJS'] = TRUE;
$config['center'] = '1600 Amphitheatre Parkway in Mountain View';
$config['zoom'] = '15';
$config['geocodeCaching'] = TRUE;
$this->googlemaps->initialize($config);
$coords=$this->dashboard_model->googlemaps($serial);
foreach($coords as $coordinate)
{
$marker=array();
$lat1=$coordinate['cycle_19_INT'].(substr($coordinate['cycle_20_INT'], 0, 2)+(substr($coordinate['cycle_20_INT'], 2).".".$coordinate['cycle_21_INT'])/60);
$lat2=str_replace($coordinate['cycle_22_INT'],'-',$coordinate['cycle_22_INT']).(substr($coordinate['cycle_23_INT'], 0, 2)+substr((substr($coordinate['cycle_23_INT'], 2).".".$coordinate['cycle_24_INT'])/60,0,7));
$lat=$lat1.','.$lat2;
$marker['position']=$lat;var_dump($marker['position']);
$this->googlemaps->add_marker($marker);
}
$data=array();
$data['map'] = $this->googlemaps->create_map();
$this->load->view('dashboard/dashboard_googlemap_view', $data);
}
|
|
|
|
|
Does anyone use this? It changes routing to be namespace-centric and groups controllers and their related views into a given namespace.
I'm not sure how this would improve things over just creating a folder and moving the controller/views into it without changing the namespaces you're already using. It also wouldn't affect the routing as far as I can determine.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I found that it doesn't lend any real value for my projects, but I'm a shop of one. For large projects with multiple contributors I can see where the value would come in.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Will Visual Studio complain if I simply move, the controller to the associated view sub-folder without changing the namespace in the controller?
EDIT =========================
The answer is no. The app acts exactly the same and there's no compiler push-back at all.
That will at least keep me from having to scroll up to get to the controller when I'm busy making the views fail spectacularly.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|